You are here

public function KeyValueFormatter::settingsSummary in Key value field 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/KeyValueFormatter.php, line 55

Class

KeyValueFormatter
Plugin implementation of the 'key_value' formatter.

Namespace

Drupal\key_value_field\Plugin\Field\FieldFormatter

Code

public function settingsSummary() {
  $summary = parent::settingsSummary();
  $key = $this
    ->getSetting('value_only') ? '' : ' [Key] : ';

  // Add a summary for the key field.
  $summary[] = t('Display format: @key [Value].', [
    '@key' => $key,
  ]);
  return $summary;
}