public function TimestampFormatter::settingsSummary in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/lib/Drupal/Core/Field/Plugin/Field/FieldFormatter/TimestampFormatter.php \Drupal\Core\Field\Plugin\Field\FieldFormatter\TimestampFormatter::settingsSummary()
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
- core/
lib/ Drupal/ Core/ Field/ Plugin/ Field/ FieldFormatter/ TimestampFormatter.php, line 150 - Contains \Drupal\Core\Field\Plugin\Field\FieldFormatter\TimestampFormatter.
Class
- TimestampFormatter
- Plugin implementation of the 'timestamp' formatter.
Namespace
Drupal\Core\Field\Plugin\Field\FieldFormatterCode
public function settingsSummary() {
$summary = parent::settingsSummary();
$date_format = $this
->getSetting('date_format');
$summary[] = $this
->t('Date format: @date_format', array(
'@date_format' => $date_format,
));
if ($this
->getSetting('date_format') === 'custom' && ($custom_date_format = $this
->getSetting('custom_date_format'))) {
$summary[] = $this
->t('Custom date format: @custom_date_format', array(
'@custom_date_format' => $custom_date_format,
));
}
if ($timezone = $this
->getSetting('timezone')) {
$summary[] = $this
->t('Time zone: @timezone', array(
'@timezone' => $timezone,
));
}
return $summary;
}