public function FormTestControllerObject::submitForm in Drupal 8
Same name and namespace in other branches
- 9 core/modules/system/tests/modules/form_test/src/FormTestControllerObject.php \Drupal\form_test\FormTestControllerObject::submitForm()
Form submission handler.
Parameters
array $form: An associative array containing the structure of the form.
\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.
Overrides ConfigFormBase::submitForm
File
- core/
modules/ system/ tests/ modules/ form_test/ src/ FormTestControllerObject.php, line 73
Class
- FormTestControllerObject
- Provides a test form object.
Namespace
Drupal\form_testCode
public function submitForm(array &$form, FormStateInterface $form_state) {
$this
->messenger()
->addStatus($this
->t('The FormTestControllerObject::submitForm() method was used for this form.'));
$this
->config('form_test.object')
->set('bananas', $form_state
->getValue('bananas'))
->save();
}