function ModalForm::submitForm

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

Overrides FormInterface::submitForm

File

modules/form_api_example/src/Form/ModalForm.php, line 138

Class

ModalForm
Implements the ModalForm form controller.

Namespace

Drupal\form_api_example\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
    $title = $form_state->getValue('title');
    $this->messenger()
        ->addMessage($this->t('Submit handler: You specified a title of @title.', [
        '@title' => $title,
    ]));
}