function SearchEmbeddedForm::submitForm
Same name in other branches
- 9 core/modules/search/tests/modules/search_embedded_form/src/Form/SearchEmbeddedForm.php \Drupal\search_embedded_form\Form\SearchEmbeddedForm::submitForm()
- 10 core/modules/search/tests/modules/search_embedded_form/src/Form/SearchEmbeddedForm.php \Drupal\search_embedded_form\Form\SearchEmbeddedForm::submitForm()
- 11.x core/modules/search/tests/modules/search_embedded_form/src/Form/SearchEmbeddedForm.php \Drupal\search_embedded_form\Form\SearchEmbeddedForm::submitForm()
Overrides FormInterface::submitForm
File
-
core/
modules/ search/ tests/ modules/ search_embedded_form/ src/ Form/ SearchEmbeddedForm.php, line 49
Class
- SearchEmbeddedForm
- Form controller for search_embedded_form form.
Namespace
Drupal\search_embedded_form\FormCode
public function submitForm(array &$form, FormStateInterface $form_state) {
$state = \Drupal::state();
$submit_count = (int) $state->get('search_embedded_form.submit_count');
$state->set('search_embedded_form.submit_count', $submit_count + 1);
$this->messenger()
->addStatus($this->t('Test form was submitted'));
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.