You are here

public function LinkClassFormatter::settingsSummary in Open Social 10.3.x

Same name and namespace in other branches
  1. 8.9 modules/social_features/social_core/src/Plugin/Field/FieldFormatter/LinkClassFormatter.php \Drupal\social_core\Plugin\Field\FieldFormatter\LinkClassFormatter::settingsSummary()
  2. 8.8 modules/social_features/social_core/src/Plugin/Field/FieldFormatter/LinkClassFormatter.php \Drupal\social_core\Plugin\Field\FieldFormatter\LinkClassFormatter::settingsSummary()
  3. 10.0.x modules/social_features/social_core/src/Plugin/Field/FieldFormatter/LinkClassFormatter.php \Drupal\social_core\Plugin\Field\FieldFormatter\LinkClassFormatter::settingsSummary()
  4. 10.1.x modules/social_features/social_core/src/Plugin/Field/FieldFormatter/LinkClassFormatter.php \Drupal\social_core\Plugin\Field\FieldFormatter\LinkClassFormatter::settingsSummary()
  5. 10.2.x modules/social_features/social_core/src/Plugin/Field/FieldFormatter/LinkClassFormatter.php \Drupal\social_core\Plugin\Field\FieldFormatter\LinkClassFormatter::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 LinkFormatter::settingsSummary

File

modules/social_features/social_core/src/Plugin/Field/FieldFormatter/LinkClassFormatter.php, line 49

Class

LinkClassFormatter
Plugin implementation of the 'link' formatter.

Namespace

Drupal\social_core\Plugin\Field\FieldFormatter

Code

public function settingsSummary() {
  $summary = parent::settingsSummary();
  $settings = $this
    ->getSettings();
  if (!empty($settings['class'])) {
    $summary[] = t('Class(es) on button = "@classes"', [
      '@classes' => $settings['class'],
    ]);
  }
  return $summary;
}