public function ColorapiRawHexDisplayFormatter::settingsSummary in Color API 8
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 ColorapiDisplayFormatterBase::settingsSummary
File
- src/
Plugin/ Field/ FieldFormatter/ ColorapiRawHexDisplayFormatter.php, line 34
Class
- ColorapiRawHexDisplayFormatter
- Raw hexadecimal formatter for Color API Color fields.
Namespace
Drupal\colorapi\Plugin\Field\FieldFormatterCode
public function settingsSummary() {
$summary = [];
$summary['overview'] = $this
->t('Displays a hexadecimal representation of the color, with no HTML wrappers');
if ($this
->getSetting('show_hash')) {
$show_hash = $this
->t('Yes');
}
else {
$show_hash = $this
->t('No');
}
$summary['show_hash'] = $this
->t('Prefix with hash (#) symbol: @value', [
'@value' => $show_hash,
]);
return $summary + parent::settingsSummary();
}