public function TextareaWithSummaryWidget::settingsForm in Zircon Profile 8.0
Same name and namespace in other branches
- 8 core/modules/text/src/Plugin/Field/FieldWidget/TextareaWithSummaryWidget.php \Drupal\text\Plugin\Field\FieldWidget\TextareaWithSummaryWidget::settingsForm()
Returns a form to configure settings for the widget.
Invoked from \Drupal\field_ui\Form\EntityDisplayFormBase to allow administrators to configure the widget. The field_ui module takes care of handling submitted form values.
Parameters
array $form: The form where the settings form is being included in.
\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.
Return value
array The form definition for the widget settings.
Overrides StringTextareaWidget::settingsForm
File
- core/
modules/ text/ src/ Plugin/ Field/ FieldWidget/ TextareaWithSummaryWidget.php, line 41 - Contains \Drupal\text\Plugin\Field\FieldWidget\TextareaWithSummaryWidget.
Class
- TextareaWithSummaryWidget
- Plugin implementation of the 'text_textarea_with_summary' widget.
Namespace
Drupal\text\Plugin\Field\FieldWidgetCode
public function settingsForm(array $form, FormStateInterface $form_state) {
$element = parent::settingsForm($form, $form_state);
$element['summary_rows'] = array(
'#type' => 'number',
'#title' => t('Summary rows'),
'#default_value' => $this
->getSetting('summary_rows'),
'#required' => TRUE,
'#min' => 1,
);
return $element;
}