public function YouTubeThumbFormatter::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/ YouTubeThumbFormatter.php, line 64
Class
- YouTubeThumbFormatter
- Plugin implementation of the 'youtube_thumbnail' formatter.
Namespace
Drupal\youtube\Plugin\Field\FieldFormatterCode
public function settingsSummary() {
$summary = [];
$image_style = $this
->getSetting('image_style');
$image_link = $this
->getSetting('image_link');
if ($image_style) {
$summary[] = $this
->t('Image style: @style_name.', [
'@style_name' => $image_style,
]);
}
if ($image_link) {
$summary[] = $this
->t('Linked to: @image_link.', [
'@image_link' => $image_link,
]);
}
return $summary;
}