public function YouTubeDefaultWidget::settingsSummary in YouTube Field 8
Returns a short summary for the current widget settings.
If an empty result is returned, a UI can still be provided to display a settings form in case the widget has configurable settings.
Return value
array A short summary of the widget settings.
Overrides WidgetBase::settingsSummary
File
- src/
Plugin/ Field/ FieldWidget/ YouTubeDefaultWidget.php, line 50
Class
- YouTubeDefaultWidget
- Plugin implementation of the 'youtube_default' widget.
Namespace
Drupal\youtube\Plugin\Field\FieldWidgetCode
public function settingsSummary() {
$summary = [];
$placeholder_url = $this
->getSetting('placeholder_url');
if (empty($placeholder_url)) {
$summary[] = $this
->t('No placeholders');
}
else {
if (!empty($placeholder_url)) {
$summary[] = $this
->t('URL placeholder: @placeholder_url', [
'@placeholder_url' => $placeholder_url,
]);
}
}
return $summary;
}