function ColorBackgroudFormatter::settingsSummary
Same name in other branches
- 3.x modules/field_example/src/Plugin/Field/FieldFormatter/ColorBackgroudFormatter.php \Drupal\field_example\Plugin\Field\FieldFormatter\ColorBackgroudFormatter::settingsSummary()
Overrides FormatterBase::settingsSummary
File
-
modules/
field_example/ src/ Plugin/ Field/ FieldFormatter/ ColorBackgroudFormatter.php, line 104
Class
- ColorBackgroudFormatter
- Plugin implementation of the 'field_example_color_background' formatter.
Namespace
Drupal\field_example\Plugin\Field\FieldFormatterCode
public function settingsSummary() {
// This optional summary text is displayed on the manage displayed in place
// of the formatter configuration form when the form is closed. You'll
// usually see it in the list of fields on the manage display page where
// this formatter is used.
$state = $this->getSetting('adjust_text_color') ? $this->t('yes') : $this->t('no');
$summary[] = $this->t('Adjust text color: @state', [
'@state' => $state,
]);
return $summary;
}