You are here

public function UriWidget::settingsSummary in Drupal 8

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

Class

UriWidget
Plugin implementation of the 'uri' widget.

Namespace

Drupal\Core\Field\Plugin\Field\FieldWidget

Code

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