You are here

public function ButtonFieldHtml::settingsSummary in Button Field 8

Same name in this branch
  1. 8 src/Plugin/Field/FieldFormatter/ButtonFieldHtml.php \Drupal\button_field\Plugin\Field\FieldFormatter\ButtonFieldHtml::settingsSummary()
  2. 8 src/Plugin/Field/FieldWidget/ButtonFieldHtml.php \Drupal\button_field\Plugin\Field\FieldWidget\ButtonFieldHtml::settingsSummary()

Returns a short summary for the current widget settings.

If an empty result is returned, a UI can still be provided to display a settings form in case the widget has configurable settings.

Return value

array A short summary of the widget settings.

Overrides WidgetBase::settingsSummary

File

src/Plugin/Field/FieldWidget/ButtonFieldHtml.php, line 51
Contains Drupal\button_field\Plugin\Field\FieldWidget\ButtonFieldHtml.

Class

ButtonFieldHtml
Plugin implementation of the 'button html' widget.

Namespace

Drupal\button_field\Plugin\Field\FieldWidget

Code

public function settingsSummary() {
  $summary = array();
  $summary[] = t('Button title: !text', array(
    '!text' => $this
      ->getSetting('text') ?: $this->fieldDefinition
      ->getLabel(),
  ));
  return $summary;
}