You are here

public function TextareaWithSummaryWidget::settingsSummary in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/text/src/Plugin/Field/FieldWidget/TextareaWithSummaryWidget.php \Drupal\text\Plugin\Field\FieldWidget\TextareaWithSummaryWidget::settingsSummary()

Returns a short summary for the current widget settings.

If an empty result is returned, a UI can still be provided to display a settings form in case the widget has configurable settings.

Return value

array A short summary of the widget settings.

Overrides StringTextareaWidget::settingsSummary

File

core/modules/text/src/Plugin/Field/FieldWidget/TextareaWithSummaryWidget.php, line 58

Class

TextareaWithSummaryWidget
Plugin implementation of the 'text_textarea_with_summary' widget.

Namespace

Drupal\text\Plugin\Field\FieldWidget

Code

public function settingsSummary() {
  $summary = parent::settingsSummary();
  $summary[] = t('Number of summary rows: @rows', [
    '@rows' => $this
      ->getSetting('summary_rows'),
  ]);
  if ($this
    ->getSetting('show_summary')) {
    $summary[] = t('Summary field will always be visible');
  }
  return $summary;
}