You are here

public function GpgKeyWidget::settingsSummary in Mailhandler 8

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/GpgKeyWidget.php, line 82

Class

GpgKeyWidget
Plugin implementation of the 'mailhandler_gpg' widget.

Namespace

Drupal\mailhandler\Plugin\Field\FieldWidget

Code

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