You are here

public function StatesListFormatter::settingsSummary in Workflows Field 8

Same name and namespace in other branches
  1. 2.x src/Plugin/Field/FieldFormatter/StatesListFormatter.php \Drupal\workflows_field\Plugin\Field\FieldFormatter\StatesListFormatter::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

src/Plugin/Field/FieldFormatter/StatesListFormatter.php, line 123

Class

StatesListFormatter
Plugin implementation of the 'workflows_field_state_list' formatter.

Namespace

Drupal\workflows_field\Plugin\Field\FieldFormatter

Code

public function settingsSummary() {
  $summary = [];
  if ($excluded = array_filter($this
    ->getSetting('excluded_states'))) {
    $summary[] = $this
      ->t('Excluded states: @states', [
      '@states' => implode(', ', $excluded),
    ]);
  }
  else {
    $summary[] = $this
      ->t('Excluded states: n/a');
  }
  return $summary;
}