You are here

public function DescriptionAwareFileFormatterBase::settingsSummary in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/file/src/Plugin/Field/FieldFormatter/DescriptionAwareFileFormatterBase.php \Drupal\file\Plugin\Field\FieldFormatter\DescriptionAwareFileFormatterBase::settingsSummary()
  2. 9 core/modules/file/src/Plugin/Field/FieldFormatter/DescriptionAwareFileFormatterBase.php \Drupal\file\Plugin\Field\FieldFormatter\DescriptionAwareFileFormatterBase::settingsSummary()

Returns a short summary for the current formatter settings.

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

Return value

string[] A short summary of the formatter settings.

Overrides FormatterBase::settingsSummary

File

core/modules/file/src/Plugin/Field/FieldFormatter/DescriptionAwareFileFormatterBase.php, line 42

Class

DescriptionAwareFileFormatterBase
Base class for file formatters that have to deal with file descriptions.

Namespace

Drupal\file\Plugin\Field\FieldFormatter

Code

public function settingsSummary() {
  $summary = parent::settingsSummary();
  if ($this
    ->getSetting('use_description_as_link_text')) {
    $summary[] = $this
      ->t('Use description as link text');
  }
  return $summary;
}