Security update for Core, with self-updated composer
[yaffs-website] / web / core / modules / system / tests / modules / form_test / src / Form / RedirectBlockForm.php
1 <?php
2
3 namespace Drupal\form_test\Form;
4
5 use Drupal\Core\Form\FormBase;
6 use Drupal\Core\Form\FormStateInterface;
7
8 /**
9  * Builds a simple form that redirects on submit.
10  *
11  * @see \Drupal\form_test\Plugin\Block\RedirectFormBlock
12  */
13 class RedirectBlockForm extends FormBase {
14
15   /**
16    * {@inheritdoc}
17    */
18   public function getFormId() {
19     return 'redirect_block_form';
20   }
21
22   /**
23    * {@inheritdoc}
24    */
25   public function buildForm(array $form, FormStateInterface $form_state) {
26     $form['actions'] = ['#type' => 'actions'];
27     $form['actions']['submit'] = ['#type' => 'submit', '#value' => $this->t('Submit')];
28
29     return $form;
30   }
31
32   /**
33    * {@inheritdoc}
34    */
35   public function submitForm(array &$form, FormStateInterface $form_state) {
36     $form_state->setRedirect('form_test.route1', [], ['query' => ['test1' => 'test2']]);
37   }
38
39 }