You are here

public function YouTubeUrlFormatter::settingsSummary in YouTube Field 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 FormatterBase::settingsSummary

File

src/Plugin/Field/FieldFormatter/YouTubeUrlFormatter.php, line 51

Class

YouTubeUrlFormatter
Plugin implementation of the 'youtube_url' formatter.

Namespace

Drupal\youtube\Plugin\Field\FieldFormatter

Code

public function settingsSummary() {
  $summary = [];
  $link = $this
    ->getSetting('link');
  if ($link) {
    $summary[] = $this
      ->t('YouTube URL as a link.');
  }
  else {
    $summary[] = $this
      ->t('YouTube URL as plain text.');
  }
  return $summary;
}