You are here

public function TitleFormatter::settingsSummary in Manage display 8

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

src/Plugin/Field/FieldFormatter/TitleFormatter.php, line 92

Class

TitleFormatter
A field formatter for entity titles.

Namespace

Drupal\manage_display\Plugin\Field\FieldFormatter

Code

public function settingsSummary() {
  $settings = $this
    ->getSettings();
  $replacements = [
    '@tag' => $settings['tag'],
  ];
  if ($settings['linked'] && $this
    ->canLink()) {
    $summary[] = $this
      ->t('Display as @tag, linked to content', $replacements);
  }
  else {
    $summary[] = $this
      ->t('Display as @tag', $replacements);
  }
  return $summary;
}