public function TextareaWidget::settingsForm

Implements Drupal\field\Plugin\Type\Widget\WidgetInterface::settingsForm().

Overrides WidgetBase::settingsForm

File

drupal/core/modules/text/lib/Drupal/text/Plugin/field/widget/TextareaWidget.php, line 35
Definition of Drupal\text\Plugin\field\widget\TextareaWidget.

Class

TextareaWidget
Plugin implementation of the 'text_textarea' widget.

Namespace

Drupal\text\Plugin\field\widget

Code

public function settingsForm(array $form, array &$form_state) {
  $element['rows'] = array(
    '#type' => 'number',
    '#title' => t('Rows'),
    '#default_value' => $this
      ->getSetting('rows'),
    '#required' => TRUE,
    '#min' => 1,
  );
  $element['placeholder'] = array(
    '#type' => 'textfield',
    '#title' => t('Placeholder'),
    '#default_value' => $this
      ->getSetting('placeholder'),
    '#description' => t('Text that will be shown inside the field until a value is entered. This hint is usually a sample value or a brief description of the expected format.'),
  );
  return $element;
}