You are here

public function IconSelectFormatterDefault::settingsSummary in Icon Select 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/IconSelectFormatterDefault.php, line 106

Class

IconSelectFormatterDefault
Plugin implementation of the icon_select_field text formatter.

Namespace

Drupal\icon_select\Plugin\Field\FieldFormatter

Code

public function settingsSummary() {
  $summary = [];
  if ($this
    ->getSetting('apply_dimensions') && $this
    ->getSetting('width')) {
    $summary[] = $this
      ->t('Image width:') . ' ' . $this
      ->getSetting('width');
  }
  if ($this
    ->getSetting('apply_dimensions') && $this
    ->getSetting('width')) {
    $summary[] = $this
      ->t('Image height:') . ' ' . $this
      ->getSetting('height');
  }
  return $summary;
}