You are here

public function EntityReferenceLabelClassFormatter::settingsSummary in Element Class Formatter 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 EntityReferenceLabelFormatter::settingsSummary

File

src/Plugin/Field/FieldFormatter/EntityReferenceLabelClassFormatter.php, line 71

Class

EntityReferenceLabelClassFormatter
Plugin implementation of the 'file with class' formatter.

Namespace

Drupal\element_class_formatter\Plugin\Field\FieldFormatter

Code

public function settingsSummary() {
  $summary = parent::settingsSummary();
  $class = $this
    ->getSetting('class');
  if ($tag = $this
    ->getSetting('tag')) {
    $summary[] = $this
      ->t('Tag: @tag', [
      '@tag' => $tag,
    ]);
  }
  return $this
    ->elementClassSettingsSummary($summary, $class);
}