Security update for Core, with self-updated composer
[yaffs-website] / web / core / modules / system / tests / modules / form_test / src / Form / FormTestGroupFieldsetForm.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 to test the #group property on #type 'fieldset'.
10  */
11 class FormTestGroupFieldsetForm extends FormBase {
12
13   /**
14    * {@inheritdoc}
15    */
16   public function getFormId() {
17     return 'form_test_group_fieldset';
18   }
19
20   /**
21    * {@inheritdoc}
22    */
23   public function buildForm(array $form, FormStateInterface $form_state, $required = FALSE) {
24     $form['fieldset'] = [
25       '#type' => 'fieldset',
26       '#title' => 'Fieldset',
27       '#required' => !empty($required),
28     ];
29     $form['meta'] = [
30       '#type' => 'container',
31       '#title' => 'Group element',
32       '#group' => 'fieldset',
33     ];
34     $form['meta']['element'] = [
35       '#type' => 'textfield',
36       '#title' => 'Nest in container element',
37     ];
38     return $form;
39   }
40
41   /**
42    * {@inheritdoc}
43    */
44   public function submitForm(array &$form, FormStateInterface $form_state) {
45   }
46
47 }