You are here

public function ButtonFieldImage::settingsSummary in Button Field 8

Same name in this branch
  1. 8 src/Plugin/Field/FieldFormatter/ButtonFieldImage.php \Drupal\button_field\Plugin\Field\FieldFormatter\ButtonFieldImage::settingsSummary()
  2. 8 src/Plugin/Field/FieldWidget/ButtonFieldImage.php \Drupal\button_field\Plugin\Field\FieldWidget\ButtonFieldImage::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 FormatterBase::settingsSummary

File

src/Plugin/Field/FieldFormatter/ButtonFieldImage.php, line 69
Contains Drupal\button_field\Plugin\Field\FieldFormatter\ButtonFieldImage.

Class

ButtonFieldImage
Plugin implementation of the 'image button' field formatter.

Namespace

Drupal\button_field\Plugin\Field\FieldFormatter

Code

public function settingsSummary() {
  $summary = array();
  $summary[] = t('Image path: !path', array(
    '!path' => $this
      ->getSetting('image_path'),
  ));
  $summary[] = t('Alt text: !text', array(
    '!text' => $this
      ->getSetting('alt_text') ?: $this->fieldDefinition
      ->getLabel(),
  ));
  $summary[] = t('Title text: !text', array(
    '!text' => $this
      ->getSetting('title_text'),
  ));
  return $summary;
}