You are here

public function TelephoneLinkFormatter::settingsSummary in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/telephone/src/Plugin/Field/FieldFormatter/TelephoneLinkFormatter.php \Drupal\telephone\Plugin\Field\FieldFormatter\TelephoneLinkFormatter::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

core/modules/telephone/src/Plugin/Field/FieldFormatter/TelephoneLinkFormatter.php, line 48

Class

TelephoneLinkFormatter
Plugin implementation of the 'telephone_link' formatter.

Namespace

Drupal\telephone\Plugin\Field\FieldFormatter

Code

public function settingsSummary() {
  $summary = [];
  $settings = $this
    ->getSettings();
  if (!empty($settings['title'])) {
    $summary[] = t('Link using text: @title', [
      '@title' => $settings['title'],
    ]);
  }
  else {
    $summary[] = t('Link using provided telephone number.');
  }
  return $summary;
}