FormTestGroupDetailsForm.php in Zircon Profile 8
File
core/modules/system/tests/modules/form_test/src/Form/FormTestGroupDetailsForm.php
View source
<?php
namespace Drupal\form_test\Form;
use Drupal\Core\Form\FormBase;
use Drupal\Core\Form\FormStateInterface;
class FormTestGroupDetailsForm extends FormBase {
public function getFormId() {
return 'form_test_group_details';
}
public function buildForm(array $form, FormStateInterface $form_state) {
$form['details'] = array(
'#type' => 'details',
'#title' => 'Root element',
'#open' => TRUE,
);
$form['meta'] = array(
'#type' => 'details',
'#title' => 'Group element',
'#open' => TRUE,
'#group' => 'details',
);
$form['meta']['element'] = array(
'#type' => 'textfield',
'#title' => 'Nest in details element',
);
return $form;
}
public function submitForm(array &$form, FormStateInterface $form_state) {
}
}