July 2017
Intermediate to advanced
456 pages
11h 32m
English
The details type provides a collapsible area around other elements, similar to a fieldset. Fieldsets can only be used around form elements, whereas the details type can be used outside of them. Take a look at this example:
$form['name'] = array(
'#type' => 'details',
'#title' => $this->t('Name')
);
$form['name']['value'] = array(
'#type' => 'textfield',
'#title' => $this->t('Value'),
);

Read now
Unlock full access