019513d082fb2bf52c4a4d5e0dd29d910e3530b7
[yaffs-website] / web / core / modules / system / tests / modules / form_test / src / FormTestAutocompleteForm.php
1 <?php
2
3 namespace Drupal\form_test;
4
5 use Drupal\Core\Form\FormBase;
6 use Drupal\Core\Form\FormStateInterface;
7
8 /**
9  * Defines a test form using autocomplete textfields.
10  */
11 class FormTestAutocompleteForm extends FormBase {
12
13   /**
14    * {@inheritdoc}
15    */
16   public function getFormId() {
17     return 'form_test_autocomplete';
18   }
19
20   /**
21    * {@inheritdoc}
22    */
23   public function buildForm(array $form, FormStateInterface $form_state) {
24     $form['autocomplete_1'] = [
25       '#type' => 'textfield',
26       '#title' => 'Autocomplete 1',
27       '#autocomplete_route_name' => 'form_test.autocomplete_1',
28     ];
29     $form['autocomplete_2'] = [
30       '#type' => 'textfield',
31       '#title' => 'Autocomplete 2',
32       '#autocomplete_route_name' => 'form_test.autocomplete_2',
33       '#autocomplete_route_parameters' => ['param' => 'value'],
34     ];
35
36     return $form;
37   }
38
39   /**
40    * {@inheritdoc}
41    */
42   public function submitForm(array &$form, FormStateInterface $form_state) {
43   }
44
45 }