You are here

public function AdLinkFormatter::settingsSummary in Facebook Instant Articles 3.x

Same name and namespace in other branches
  1. 8.2 src/Plugin/Field/FieldFormatter/AdLinkFormatter.php \Drupal\fb_instant_articles\Plugin\Field\FieldFormatter\AdLinkFormatter::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 AdFormatter::settingsSummary

File

src/Plugin/Field/FieldFormatter/AdLinkFormatter.php, line 42

Class

AdLinkFormatter
Plugin implementation of the 'fbia_ad_link' formatter.

Namespace

Drupal\fb_instant_articles\Plugin\Field\FieldFormatter

Code

public function settingsSummary() {
  $summary = [];
  if ($width = $this
    ->getSetting('width')) {
    $summary[] = $this
      ->t('Width: @width', [
      '@width' => $width,
    ]);
  }
  if ($height = $this
    ->getSetting('height')) {
    $summary[] = $this
      ->t('Height: @height', [
      '@height' => $height,
    ]);
  }
  return $summary;
}