public function TwigWidget::settingsSummary in Twig 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/ TwigWidget.php, line 66
Class
- TwigWidget
- Defines the Twig field widget.
Namespace
Drupal\twig_field\Plugin\Field\FieldWidgetCode
public function settingsSummary() {
$settings = $this
->getSettings();
$summary[] = $this
->t('Number of rows: @rows', [
'@rows' => $settings['rows'],
]);
if ($settings['placeholder'] != '') {
$summary[] = $this
->t('Placeholder: @placeholder', [
'@placeholder' => $settings['placeholder'],
]);
}
$summary[] = $this
->t('Load toolbar: @toolbar', [
'@toolbar' => $this
->formatBoolean('toolbar'),
]);
$summary[] = $this
->t('Line wrapping: @lineWrapping', [
'@lineWrapping' => $this
->formatBoolean('lineWrapping'),
]);
$summary[] = $this
->t('Line numbers: @lineNumbers', [
'@lineNumbers' => $this
->formatBoolean('lineNumbers'),
]);
$summary[] = $this
->t('Fold gutter: @foldGutter', [
'@foldGutter' => $this
->formatBoolean('foldGutter'),
]);
$summary[] = $this
->t('Auto close tags: @autoCloseTags', [
'@autoCloseTags' => $this
->formatBoolean('autoCloseTags'),
]);
$summary[] = $this
->t('Style active line: @styleActiveLine', [
'@styleActiveLine' => $this
->formatBoolean('styleActiveLine'),
]);
return $summary;
}