You are here

public function CshsGroupByRootFormatter::settingsSummary in Client-side Hierarchical Select 8.3

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 CshsFormatterBase::settingsSummary

File

src/Plugin/Field/FieldFormatter/CshsGroupByRootFormatter.php, line 139

Class

CshsGroupByRootFormatter
Plugin implementation of the "Group by root" formatter.

Namespace

Drupal\cshs\Plugin\Field\FieldFormatter

Code

public function settingsSummary() : array {
  $summary = parent::settingsSummary();
  $summary[] = $this
    ->t('Sorting: @value', [
    '@value' => static::SORT_OPTIONS[$this
      ->getSetting('sort')],
  ]);
  $summary[] = $this
    ->t('Depth: @value', [
    '@value' => $this
      ->getSetting('depth') ?: $this
      ->t('Unlimited'),
  ]);
  return $summary;
}