You are here

public function PlainStringFormatter::settingsSummary in String field formatter 8.x

Same name and namespace in other branches
  1. 8 src/Plugin/Field/FieldFormatter/PlainStringFormatter.php \Drupal\string_field_formatter\Plugin\Field\FieldFormatter\PlainStringFormatter::settingsSummary()
  2. 2.0.x src/Plugin/Field/FieldFormatter/PlainStringFormatter.php \Drupal\string_field_formatter\Plugin\Field\FieldFormatter\PlainStringFormatter::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

src/Plugin/Field/FieldFormatter/PlainStringFormatter.php, line 76
Contains \Drupal\string_field_formatter\Plugin\Field\FieldFormatter\PlainStringFormatter.

Class

PlainStringFormatter
Plugin implementation of the 'plain_string_formatter' formatter.

Namespace

Drupal\string_field_formatter\Plugin\Field\FieldFormatter

Code

public function settingsSummary() {
  $summary = array();
  $wrap_tag = $this
    ->getSetting('wrap_tag');
  if ('_none' == $wrap_tag) {
    $summary[] = t('No wrap tag defined.');
  }
  else {
    $summary[] = t('Wrap text with tag: @tag', array(
      '@tag' => $wrap_tag,
    ));
  }
  return $summary;
}