You are here

public function StarsFormatter::settingsSummary in Fivestar 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 FormatterBase::settingsSummary

File

src/Plugin/Field/FieldFormatter/StarsFormatter.php, line 90

Class

StarsFormatter
Plugin implementation of the 'fivestar_stars' formatter.

Namespace

Drupal\fivestar\Plugin\Field\FieldFormatter

Code

public function settingsSummary() {
  $summary[] = $this
    ->t('Style: @widget', [
    '@widget' => $this->widgetManager
      ->getWidgetLabel($this
      ->getSelectedWidgetKey()),
  ]);
  $summary[] = $this
    ->t('Stars display: @style, Text display: @text', [
    '@style' => $this
      ->getSetting('display_format'),
    '@text' => $this
      ->getSetting('text_format'),
  ]);
  return $summary;
}