You are here

public function SmartDatePlainFormatter::settingsSummary in Smart Date 3.x

Same name and namespace in other branches
  1. 8.2 src/Plugin/Field/FieldFormatter/SmartDatePlainFormatter.php \Drupal\smart_date\Plugin\Field\FieldFormatter\SmartDatePlainFormatter::settingsSummary()
  2. 8 src/Plugin/Field/FieldFormatter/SmartDatePlainFormatter.php \Drupal\smart_date\Plugin\Field\FieldFormatter\SmartDatePlainFormatter::settingsSummary()
  3. 3.0.x src/Plugin/Field/FieldFormatter/SmartDatePlainFormatter.php \Drupal\smart_date\Plugin\Field\FieldFormatter\SmartDatePlainFormatter::settingsSummary()
  4. 3.1.x src/Plugin/Field/FieldFormatter/SmartDatePlainFormatter.php \Drupal\smart_date\Plugin\Field\FieldFormatter\SmartDatePlainFormatter::settingsSummary()
  5. 3.2.x src/Plugin/Field/FieldFormatter/SmartDatePlainFormatter.php \Drupal\smart_date\Plugin\Field\FieldFormatter\SmartDatePlainFormatter::settingsSummary()
  6. 3.3.x src/Plugin/Field/FieldFormatter/SmartDatePlainFormatter.php \Drupal\smart_date\Plugin\Field\FieldFormatter\SmartDatePlainFormatter::settingsSummary()
  7. 3.4.x src/Plugin/Field/FieldFormatter/SmartDatePlainFormatter.php \Drupal\smart_date\Plugin\Field\FieldFormatter\SmartDatePlainFormatter::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 DateTimeFormatterBase::settingsSummary

File

src/Plugin/Field/FieldFormatter/SmartDatePlainFormatter.php, line 96

Class

SmartDatePlainFormatter
Plugin implementation of the 'Plain' formatter for 'smartdate' fields.

Namespace

Drupal\smart_date\Plugin\Field\FieldFormatter

Code

public function settingsSummary() {
  $summary = parent::settingsSummary();
  if ($separator = $this
    ->getSetting('separator')) {
    $summary[] = $this
      ->t('Separator: %separator', [
      '%separator' => $separator,
    ]);
  }
  return $summary;
}