You are here

public function TestFieldEmptySettingFormatter::settingsSummary in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/field/tests/modules/field_test/src/Plugin/Field/FieldFormatter/TestFieldEmptySettingFormatter.php \Drupal\field_test\Plugin\Field\FieldFormatter\TestFieldEmptySettingFormatter::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

core/modules/field/tests/modules/field_test/src/Plugin/Field/FieldFormatter/TestFieldEmptySettingFormatter.php, line 49

Class

TestFieldEmptySettingFormatter
Plugin implementation of the 'field_empty_setting' formatter.

Namespace

Drupal\field_test\Plugin\Field\FieldFormatter

Code

public function settingsSummary() {
  $summary = [];
  $setting = $this
    ->getSetting('field_empty_setting');
  if (!empty($setting)) {
    $summary[] = t('Default empty setting now has a value.');
  }
  return $summary;
}