Submit.php 902 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. namespace Drupal\Core\Render\Element;
  3. /**
  4. * Provides a form submit button.
  5. *
  6. * Submit buttons are processed the same as regular buttons, except they trigger
  7. * the form's submit handler.
  8. *
  9. * Properties:
  10. * - #submit: Specifies an alternate callback for form submission when the
  11. * submit button is pressed. Use '::methodName' format or an array containing
  12. * the object and method name (for example, [ $this, 'methodName'] ).
  13. * - #value: The text to be shown on the button.
  14. *
  15. * Usage Example:
  16. * @code
  17. * $form['actions']['submit'] = array(
  18. * '#type' => 'submit',
  19. * '#value' => $this->t('Save'),
  20. * );
  21. * @endcode
  22. *
  23. * @see \Drupal\Core\Render\Element\Button
  24. *
  25. * @FormElement("submit")
  26. */
  27. class Submit extends Button {
  28. /**
  29. * {@inheritdoc}
  30. */
  31. public function getInfo() {
  32. return [
  33. '#executes_submit_callback' => TRUE,
  34. ] + parent::getInfo();
  35. }
  36. }