function FavoriteAnimalTestForm::submitForm

Same name and namespace in other branches
  1. 9 core/modules/block/tests/modules/block_test/src/Form/FavoriteAnimalTestForm.php \Drupal\block_test\Form\FavoriteAnimalTestForm::submitForm()
  2. 8.9.x core/modules/block/tests/modules/block_test/src/Form/FavoriteAnimalTestForm.php \Drupal\block_test\Form\FavoriteAnimalTestForm::submitForm()
  3. 10 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\Form

Code

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.