public function FormTestObject::submitForm in Drupal 9
Same name and namespace in other branches
- 8 core/modules/system/tests/modules/form_test/src/FormTestObject.php \Drupal\form_test\FormTestObject::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/ FormTestObject.php, line 66
Class
- FormTestObject
- Provides a test form object.
Namespace
Drupal\form_testCode
public function submitForm(array &$form, FormStateInterface $form_state) {
$this
->messenger()
->addStatus($this
->t('The FormTestObject::submitForm() method was used for this form.'));
$this
->config('form_test.object')
->set('bananas', $form_state
->getValue('bananas'))
->save();
}