public function WebformMore::form in Webform 8.5
Same name and namespace in other branches
- 6.x src/Plugin/WebformElement/WebformMore.php \Drupal\webform\Plugin\WebformElement\WebformMore::form()
Gets the actual configuration webform array to be built.
Parameters
array $form: An associative array containing the structure of the form.
\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.
Return value
array An associative array contain the element's configuration webform without any default values.
Overrides WebformMarkupBase::form
File
- src/
Plugin/ WebformElement/ WebformMore.php, line 38
Class
- WebformMore
- Provides a 'item' element.
Namespace
Drupal\webform\Plugin\WebformElementCode
public function form(array $form, FormStateInterface $form_state) {
$form = parent::form($form, $form_state);
$form['markup']['#title'] = $this
->t('Webform settings');
$form['markup']['more_title'] = [
'#type' => 'textfield',
'#title' => $this
->t('More title'),
'#description' => $this
->t('The click-able label used to open and close more text.'),
'#required' => TRUE,
];
$form['markup']['more'] = [
'#type' => 'webform_html_editor',
'#title' => $this
->t('More text'),
'#description' => $this
->t('A long description of the element that provides form additional information which can opened and closed.'),
'#required' => TRUE,
];
return $form;
}