You are here

public function FontAwesomeIconFormatter::settingsSummary in Font Awesome Icons 8.2

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/FontAwesomeIconFormatter.php, line 84

Class

FontAwesomeIconFormatter
Implementation of Font Awesome icon formatter.

Namespace

Drupal\fontawesome\Plugin\Field\FieldFormatter

Code

public function settingsSummary() {
  $settings = $this
    ->getSettings();
  $summary = [];

  // Load the configuration settings.
  $configuration_settings = $this->configFactory
    ->get('fontawesome.settings');

  // Show whether or not we are layering the icons.
  $summary[] = $this
    ->t('Display multi-value fields as layers: <strong>@layersSetting</strong>', [
    '@layersSetting' => $settings['layers'] && $configuration_settings
      ->get('method') != 'webfonts' ? 'Yes' : 'No',
  ]);
  return $summary;
}