14dcb0c3374a4f85170dbd21ce6db5ea60645c98
[yaffs-website] / web / core / modules / system / tests / modules / form_test / src / Form / FormTestEmptySelectForm.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 form to test select elements when #options is not an array.
10  */
11 class FormTestEmptySelectForm extends FormBase {
12
13   /**
14    * {@inheritdoc}
15    */
16   public function getFormId() {
17     return 'form_test_empty_select';
18   }
19
20   /**
21    * {@inheritdoc}
22    */
23   public function buildForm(array $form, FormStateInterface $form_state) {
24     $form['empty_select'] = [
25       '#type' => 'select',
26       '#title' => t('Empty Select'),
27       '#multiple' => FALSE,
28       '#options' => NULL,
29     ];
30     return $form;
31   }
32
33   /**
34    * {@inheritdoc}
35    */
36   public function submitForm(array &$form, FormStateInterface $form_state) {
37   }
38
39 }