
| Current Path : /var/www/html1/bbp/web/core/modules/system/tests/modules/form_test/src/ |
Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 |
| Current File : /var/www/html1/bbp/web/core/modules/system/tests/modules/form_test/src/FormTestAutocompleteForm.php |
<?php
namespace Drupal\form_test;
use Drupal\Core\Form\FormBase;
use Drupal\Core\Form\FormStateInterface;
/**
* Defines a test form using autocomplete textfields.
*
* @internal
*/
class FormTestAutocompleteForm extends FormBase {
/**
* {@inheritdoc}
*/
public function getFormId() {
return 'form_test_autocomplete';
}
/**
* {@inheritdoc}
*/
public function buildForm(array $form, FormStateInterface $form_state) {
$form['autocomplete_1'] = [
'#type' => 'textfield',
'#title' => 'Autocomplete 1',
'#autocomplete_route_name' => 'form_test.autocomplete_1',
];
$form['autocomplete_2'] = [
'#type' => 'textfield',
'#title' => 'Autocomplete 2',
'#autocomplete_route_name' => 'form_test.autocomplete_2',
'#autocomplete_route_parameters' => ['param' => 'value'],
];
$form['autocomplete_3'] = [
'#type' => 'container',
'#attributes' => [
'class' => [
'container-inline',
],
],
'autocomplete_3' => [
'#type' => 'textfield',
'#title' => 'Autocomplete 3',
'#autocomplete_route_name' => 'form_test.autocomplete_1',
],
];
return $form;
}
/**
* {@inheritdoc}
*/
public function submitForm(array &$form, FormStateInterface $form_state) {
}
}