You are here

public function FieldFormatterFromViewDisplay::settingsSummary in (Entity Reference) Field Formatters 8

Same name and namespace in other branches
  1. 8.2 src/Plugin/Field/FieldFormatter/FieldFormatterFromViewDisplay.php \Drupal\field_formatter\Plugin\Field\FieldFormatter\FieldFormatterFromViewDisplay::settingsSummary()
  2. 3.x src/Plugin/Field/FieldFormatter/FieldFormatterFromViewDisplay.php \Drupal\field_formatter\Plugin\Field\FieldFormatter\FieldFormatterFromViewDisplay::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 FieldFormatterBase::settingsSummary

File

src/Plugin/Field/FieldFormatter/FieldFormatterFromViewDisplay.php, line 145

Class

FieldFormatterFromViewDisplay
Plugin implementation of the 'link' formatter.

Namespace

Drupal\field_formatter\Plugin\Field\FieldFormatter

Code

public function settingsSummary() {
  $summary = parent::settingsSummary();
  if ($view_mode = $this
    ->getSetting('view_mode')) {
    $summary[] = $this
      ->t('View display %view_mode used.', [
      '%view_mode' => $view_mode,
    ]);
  }
  else {
    $summary[] = $this
      ->t('View display not configured.');
  }
  return $summary;
}