You are here

public function TestFieldEmptySettingFormatter::settingsSummary in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 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 54
Contains \Drupal\field_test\Plugin\Field\FieldFormatter\TestFieldEmptySettingFormatter.

Class

TestFieldEmptySettingFormatter
Plugin implementation of the 'field_empty_setting' formatter.

Namespace

Drupal\field_test\Plugin\Field\FieldFormatter

Code

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