3 namespace Drupal\form_test\Form;
5 use Drupal\Core\Form\FormBase;
6 use Drupal\Core\Form\FormStateInterface;
9 * Builds a simple form to test the #group property on #type 'details'.
13 class FormTestGroupDetailsForm extends FormBase {
18 public function getFormId() {
19 return 'form_test_group_details';
25 public function buildForm(array $form, FormStateInterface $form_state, $required = FALSE) {
28 '#title' => 'Root element',
30 '#required' => !empty($required),
34 '#title' => 'Group element',
36 '#group' => 'details',
38 $form['meta']['element'] = [
39 '#type' => 'textfield',
40 '#title' => 'Nest in details element',
48 public function submitForm(array &$form, FormStateInterface $form_state) {