class Submit
Provides a form submit button.
Submit buttons are processed the same as regular buttons, except they trigger the form's submit handler.
Properties:
- #submit: Specifies an alternate callback for form submission when the submit button is pressed. Use '::methodName' format or an array containing the object and method name (for example, [ $this, 'methodName'] ).
- #value: The text to be shown on the button.
Usage Example:
$form['actions']['submit'] = [
'#type' => 'submit',
'#value' => $this->t('Save'),
];
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements \Drupal\Component\Plugin\PluginInspectionInterface, \Drupal\Component\Plugin\DerivativeInspectionInterface
- class \Drupal\Core\Plugin\PluginBase extends \Drupal\Component\Plugin\PluginBase uses \Drupal\Core\StringTranslation\StringTranslationTrait, \Drupal\Core\DependencyInjection\DependencySerializationTrait, \Drupal\Core\Messenger\MessengerTrait
- class \Drupal\Core\Render\Element\RenderElementBase extends \Drupal\Core\Plugin\PluginBase implements \Drupal\Core\Render\Element\ElementInterface
- class \Drupal\Core\Render\Element\FormElementBase extends \Drupal\Core\Render\Element\RenderElementBase implements \Drupal\Core\Render\Element\FormElementInterface
- class \Drupal\Core\Render\Element\RenderElementBase extends \Drupal\Core\Plugin\PluginBase implements \Drupal\Core\Render\Element\ElementInterface
- class \Drupal\Core\Plugin\PluginBase extends \Drupal\Component\Plugin\PluginBase uses \Drupal\Core\StringTranslation\StringTranslationTrait, \Drupal\Core\DependencyInjection\DependencySerializationTrait, \Drupal\Core\Messenger\MessengerTrait
Expanded class hierarchy of Submit
See also
\Drupal\Core\Render\Element\Button
21 string references to 'Submit'
- BrowserKitDriver::canSubmitForm in vendor/
behat/ mink-browserkit-driver/ src/ BrowserKitDriver.php - BrowserKitDriver::getFormField in vendor/
behat/ mink-browserkit-driver/ src/ BrowserKitDriver.php - Returns form field from XPath query.
- BrowserKitDriver::getValue in vendor/
behat/ mink-browserkit-driver/ src/ BrowserKitDriver.php - Returns element's value by its XPath query.
- BrowserKitDriver::mergeForms in vendor/
behat/ mink-browserkit-driver/ src/ BrowserKitDriver.php - Merges second form values into first one.
- Button::preRenderButton in core/
lib/ Drupal/ Core/ Render/ Element/ Button.php - Prepares a #type 'button' render element for input.html.twig.
File
-
core/
lib/ Drupal/ Core/ Render/ Element/ Submit.php, line 29
Namespace
Drupal\Core\Render\ElementView source
class Submit extends Button {
/**
* {@inheritdoc}
*/
public function getInfo() {
return [
'#executes_submit_callback' => TRUE,
] + parent::getInfo();
}
}
Members
Title Sort descending | Modifiers | Object type | Summary | Overriden Title | Overrides |
---|---|---|---|---|---|
Button::preRenderButton | public static | function | Prepares a #type 'button' render element for input.html.twig. | 1 | |
Button::processButton | public static | function | Processes a form button element. | ||
FormElementBase::processAutocomplete | public static | function | Adds autocomplete functionality to elements. | 1 | |
FormElementBase::processPattern | public static | function | #process callback for #pattern form element property. | 1 | |
FormElementBase::validatePattern | public static | function | #element_validate callback for #pattern form element property. | 1 | |
FormElementBase::valueCallback | public static | function | Determines how user input is mapped to an element's #value property. | Overrides FormElementInterface::valueCallback | 17 |
PluginInspectionInterface::getPluginDefinition | public | function | Gets the definition of the plugin implementation. | 5 | |
PluginInspectionInterface::getPluginId | public | function | Gets the plugin ID of the plugin instance. | 2 | |
RenderElementBase::preRenderAjaxForm | public static | function | Adds Ajax information about an element to communicate with JavaScript. | 2 | |
RenderElementBase::preRenderGroup | public static | function | Adds members of this group as actual elements for rendering. | 2 | |
RenderElementBase::processAjaxForm | public static | function | Form element processing handler for the #ajax form property. | 3 | |
RenderElementBase::processGroup | public static | function | Arranges elements into groups. | 2 | |
RenderElementBase::setAttributes | public static | function | Sets a form element's class attribute. | Overrides ElementInterface::setAttributes | 2 |
Submit::getInfo | public | function | Returns the element properties for this element. | Overrides Button::getInfo | 1 |