function RedirectBlockForm::submitForm

Same name in other branches
  1. 9 core/modules/system/tests/modules/form_test/src/Form/RedirectBlockForm.php \Drupal\form_test\Form\RedirectBlockForm::submitForm()
  2. 10 core/modules/system/tests/modules/form_test/src/Form/RedirectBlockForm.php \Drupal\form_test\Form\RedirectBlockForm::submitForm()
  3. 11.x core/modules/system/tests/modules/form_test/src/Form/RedirectBlockForm.php \Drupal\form_test\Form\RedirectBlockForm::submitForm()

Overrides FormInterface::submitForm

File

core/modules/system/tests/modules/form_test/src/Form/RedirectBlockForm.php, line 37

Class

RedirectBlockForm
Builds a simple form that redirects on submit.

Namespace

Drupal\form_test\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
    $form_state->setRedirect('form_test.route1', [], [
        'query' => [
            'test1' => 'test2',
        ],
    ]);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.