function StringTextareaWidget::settingsSummary

Same name in other branches
  1. 8.9.x core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/StringTextareaWidget.php \Drupal\Core\Field\Plugin\Field\FieldWidget\StringTextareaWidget::settingsSummary()
  2. 10 core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/StringTextareaWidget.php \Drupal\Core\Field\Plugin\Field\FieldWidget\StringTextareaWidget::settingsSummary()
  3. 11.x core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/StringTextareaWidget.php \Drupal\Core\Field\Plugin\Field\FieldWidget\StringTextareaWidget::settingsSummary()

Overrides WidgetBase::settingsSummary

1 call to StringTextareaWidget::settingsSummary()
TextareaWithSummaryWidget::settingsSummary in core/modules/text/src/Plugin/Field/FieldWidget/TextareaWithSummaryWidget.php
Returns a short summary for the current widget settings.
1 method overrides StringTextareaWidget::settingsSummary()
TextareaWithSummaryWidget::settingsSummary in core/modules/text/src/Plugin/Field/FieldWidget/TextareaWithSummaryWidget.php
Returns a short summary for the current widget settings.

File

core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/StringTextareaWidget.php, line 55

Class

StringTextareaWidget
Plugin implementation of the 'string_textarea' widget.

Namespace

Drupal\Core\Field\Plugin\Field\FieldWidget

Code

public function settingsSummary() {
    $summary = [];
    $summary[] = $this->t('Number of rows: @rows', [
        '@rows' => $this->getSetting('rows'),
    ]);
    $placeholder = $this->getSetting('placeholder');
    if (!empty($placeholder)) {
        $summary[] = $this->t('Placeholder: @placeholder', [
            '@placeholder' => $placeholder,
        ]);
    }
    return $summary;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.