function SelectForm::submitForm

Same name in other branches
  1. 4.0.x modules/theming_example/src/Form/SelectForm.php \Drupal\theming_example\Form\SelectForm::submitForm()

Overrides FormInterface::submitForm

File

modules/theming_example/src/Form/SelectForm.php, line 49

Class

SelectForm
A simple form that displays a select box and submit button.

Namespace

Drupal\theming_example\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
    $this->messenger()
        ->addMessage($this->t('You chose %input', [
        '%input' => $form_state->getValue('choice'),
    ]));
}