You are here

public function GeolocationTokenFormatter::settingsSummary in Geolocation Field 8

Same name and namespace in other branches
  1. 8.3 src/Plugin/Field/FieldFormatter/GeolocationTokenFormatter.php \Drupal\geolocation\Plugin\Field\FieldFormatter\GeolocationTokenFormatter::settingsSummary()
  2. 8.2 src/Plugin/Field/FieldFormatter/GeolocationTokenFormatter.php \Drupal\geolocation\Plugin\Field\FieldFormatter\GeolocationTokenFormatter::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/GeolocationTokenFormatter.php, line 59

Class

GeolocationTokenFormatter
Plugin implementation of the 'geolocation_token' formatter.

Namespace

Drupal\geolocation\Plugin\Field\FieldFormatter

Code

public function settingsSummary() {
  $settings = $this
    ->getSettings();
  $summary = [];
  $summary[] = $this
    ->t('Tokenized Text: %text', [
    '%text' => Unicode::truncate($settings['tokenized_text'], 100, TRUE, TRUE),
  ]);
  return $summary;
}