You are here

public function FileLinkClassFormatter::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 DescriptionAwareFileFormatterBase::settingsSummary

File

src/Plugin/Field/FieldFormatter/FileLinkClassFormatter.php, line 63

Class

FileLinkClassFormatter
Plugin implementation of the 'file link with class' formatter.

Namespace

Drupal\element_class_formatter\Plugin\Field\FieldFormatter

Code

public function settingsSummary() {
  $summary = parent::settingsSummary();
  $class = $this
    ->getSetting('class');
  if ($size = $this
    ->getSetting('show_filesize')) {
    $summary[] = $this
      ->t('Show file size');
  }
  if ($type = $this
    ->getSetting('show_filetype')) {
    $summary[] = $this
      ->t('Show file type');
  }
  return $this
    ->elementClassSettingsSummary($summary, $class);
}