public function GutenbergTextFormatter::settingsSummary in Gutenberg 8.2
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/ GutenbergTextFormatter.php, line 76
Class
- GutenbergTextFormatter
- Plugin implementation of the 'gutenberg_text' formatter.
Namespace
Drupal\gutenberg\Plugin\Field\FieldFormatterCode
public function settingsSummary() {
$summary = [];
$summary[] = $this
->t('Gutenberg format: @format.', [
'@format' => $this
->getSetting('format'),
]);
if ($this
->getSetting('content_only')) {
$summary[] = $this
->t('Render without field wrappers.');
}
else {
$summary[] = $this
->t('Render with field wrappers.');
}
return $summary;
}