function FavoriteAnimalTestForm::submitForm
Same name in other branches
- 8.9.x core/modules/block/tests/modules/block_test/src/Form/FavoriteAnimalTestForm.php \Drupal\block_test\Form\FavoriteAnimalTestForm::submitForm()
- 10 core/modules/block/tests/modules/block_test/src/Form/FavoriteAnimalTestForm.php \Drupal\block_test\Form\FavoriteAnimalTestForm::submitForm()
- 11.x core/modules/block/tests/modules/block_test/src/Form/FavoriteAnimalTestForm.php \Drupal\block_test\Form\FavoriteAnimalTestForm::submitForm()
Overrides FormInterface::submitForm
File
-
core/
modules/ block/ tests/ modules/ block_test/ src/ Form/ FavoriteAnimalTestForm.php, line 42
Class
- FavoriteAnimalTestForm
- Form that performs favorite animal test.
Namespace
Drupal\block_test\FormCode
public function submitForm(array &$form, FormStateInterface $form_state) {
$this->messenger()
->addStatus($this->t('Your favorite animal is: @favorite_animal', [
'@favorite_animal' => $form['favorite_animal']['#value'],
]));
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.