You are here

public function AmazonFieldWidget::settingsSummary in Amazon Product Advertisement API 8.2

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

modules/amazon_field/src/Plugin/Field/FieldWidget/AmazonFieldWidget.php, line 58

Class

AmazonFieldWidget
Plugin implementation of the 'amazon_field_widget' widget.

Namespace

Drupal\amazon_field\Plugin\Field\FieldWidget

Code

public function settingsSummary() {
  $summary = [];
  $summary[] = t('Textfield size: @size', array(
    '@size' => $this
      ->getSetting('size'),
  ));
  if (!empty($this
    ->getSetting('placeholder'))) {
    $summary[] = t('Placeholder: @placeholder', array(
      '@placeholder' => $this
        ->getSetting('placeholder'),
    ));
  }
  return $summary;
}