You are here

public function ViewsReferenceFieldFormatter::settingsSummary in Views Reference Field 8.2

Same name and namespace in other branches
  1. 8 src/Plugin/Field/FieldFormatter/ViewsReferenceFieldFormatter.php \Drupal\viewsreference\Plugin\Field\FieldFormatter\ViewsReferenceFieldFormatter::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

src/Plugin/Field/FieldFormatter/ViewsReferenceFieldFormatter.php, line 54

Class

ViewsReferenceFieldFormatter
Field formatter for Viewsreference Field.

Namespace

Drupal\viewsreference\Plugin\Field\FieldFormatter

Code

public function settingsSummary() {
  $summary = [];
  $allowed = [];
  $settings = $this
    ->getSettings();
  foreach ($settings['plugin_types'] as $type) {
    if ($type) {
      $allowed[] = $type;
    }
  }
  $summary[] = $this
    ->t('Allowed plugins: @view', [
    '@view' => implode(', ', $allowed),
  ]);
  return $summary;
}