You are here

public function EmailDefaultWidget::settingsSummary in Drupal 10

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/EmailDefaultWidget.php \Drupal\Core\Field\Plugin\Field\FieldWidget\EmailDefaultWidget::settingsSummary()
  2. 9 core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/EmailDefaultWidget.php \Drupal\Core\Field\Plugin\Field\FieldWidget\EmailDefaultWidget::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

core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/EmailDefaultWidget.php, line 56

Class

EmailDefaultWidget
Plugin implementation of the 'email_default' widget.

Namespace

Drupal\Core\Field\Plugin\Field\FieldWidget

Code

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