You are here

public function HtmlFormatterTrait::getHtmlFormatterSettingsSummary in HTML Formatter 8

Get summary for html formatter.

Return value

array

4 calls to HtmlFormatterTrait::getHtmlFormatterSettingsSummary()
HtmlFieldFormatter::settingsSummary in src/Plugin/Field/FieldFormatter/HtmlFieldFormatter.php
Returns a short summary for the current formatter settings.
HtmlFieldFormatterDateTime::settingsSummary in src/Plugin/Field/FieldFormatter/HtmlFieldFormatterDateTime.php
Returns a short summary for the current formatter settings.
HtmlFieldFormatterEntityReference::settingsSummary in src/Plugin/Field/FieldFormatter/HtmlFieldFormatterEntityReference.php
Returns a short summary for the current formatter settings.
HtmlFieldFormatterTimestamp::settingsSummary in src/Plugin/Field/FieldFormatter/HtmlFieldFormatterTimestamp.php
Returns a short summary for the current formatter settings.

File

src/Plugin/HtmlFormatterTrait.php, line 59

Class

HtmlFormatterTrait

Namespace

Drupal\html_formatter\Plugin

Code

public function getHtmlFormatterSettingsSummary($settings) {
  $summary = [];
  if (!empty($settings['tag'])) {
    $summary[] = $this
      ->t('Rendered with HTML tag: @tag', [
      '@tag' => $settings['tag'],
    ]);
  }
  if (!empty($settings['class'])) {
    $summary[] = $this
      ->t('With class: @class', [
      '@class' => $settings['class'],
    ]);
  }
  if (!empty($settings['link'])) {
    $summary[] = $this
      ->t('Linked to Content');
  }
  return $summary;
}