You are here

public function FileUrlFormatter::settingsSummary in File URL 8

Same name and namespace in other branches
  1. 2.0.x src/Plugin/Field/FieldFormatter/FileUrlFormatter.php \Drupal\file_url\Plugin\Field\FieldFormatter\FileUrlFormatter::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/FileUrlFormatter.php, line 54

Class

FileUrlFormatter
Plugin implementation of the 'file_default' formatter.

Namespace

Drupal\file_url\Plugin\Field\FieldFormatter

Code

public function settingsSummary() {
  $summary = parent::settingsSummary();
  switch ($this
    ->getSetting('mode')) {
    case 'link':
      $summary[] = $this
        ->t('Link to file with file name and extension as text');
      break;
    case 'plain':
      $summary[] = $this
        ->t('Plain URL');
  }
  return $summary;
}