public function BynderVideoFormatter::settingsSummary in Bynder 4.0.x
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/ BynderVideoFormatter.php, line 89
Class
- BynderVideoFormatter
- Plugin implementation of the 'Bynder Video' formatter.
Namespace
Drupal\bynder\Plugin\Field\FieldFormatterCode
public function settingsSummary() {
$summary = parent::settingsSummary();
$summary[] = $this
->t('Controls: %controls', [
'%controls' => $this
->getSetting('controls') ? $this
->t('yes') : $this
->t('no'),
]);
$summary[] = $this
->t('Autoplay: %autoplay', [
'%autoplay' => $this
->getSetting('autoplay') ? $this
->t('yes') : $this
->t('no'),
]);
$summary[] = $this
->t('Loop: %loop', [
'%loop' => $this
->getSetting('loop') ? $this
->t('yes') : $this
->t('no'),
]);
$summary[] = $this
->t('Muted: %muted', [
'%muted' => $this
->getSetting('muted') ? $this
->t('yes') : $this
->t('no'),
]);
$summary[] = $this
->t('Size: %width x %height pixels', [
'%width' => $this
->getSetting('width'),
'%height' => $this
->getSetting('height'),
]);
return $summary;
}