You are here

public function AutocompleteDeluxeWidget::settingsSummary in Autocomplete Deluxe 8

Same name and namespace in other branches
  1. 2.0.x src/Plugin/Field/FieldWidget/AutocompleteDeluxeWidget.php \Drupal\autocomplete_deluxe\Plugin\Field\FieldWidget\AutocompleteDeluxeWidget::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/AutocompleteDeluxeWidget.php, line 154

Class

AutocompleteDeluxeWidget
Plugin implementation of the 'options_buttons' widget.

Namespace

Drupal\autocomplete_deluxe\Plugin\Field\FieldWidget

Code

public function settingsSummary() {
  $summary = [];
  $summary[] = $this
    ->t('Limit: @limit', [
    '@limit' => $this
      ->getSetting('limit'),
  ]);
  $summary[] = $this
    ->t('Min length: @min_length', [
    '@min_length' => $this
      ->getSetting('min_length'),
  ]);
  $summary[] = $this
    ->t('Delimiter: @delimiter', [
    '@delimiter' => $this
      ->getSetting('delimiter'),
  ]);
  $summary[] = $this
    ->t('Allow Not Found message: @not_found_message_allow', [
    '@not_found_message_allow' => $this
      ->getSetting('not_found_message_allow') ? 'Yes' : 'No',
  ]);
  $summary[] = $this
    ->t('Not Found message: @not_found_message', [
    '@not_found_message' => $this
      ->getSetting('not_found_message'),
  ]);
  $summary[] = $this
    ->t('Allow new terms: @new_terms', [
    '@new_terms' => $this
      ->getSetting('new_terms') ? 'Yes' : 'No',
  ]);
  $summary[] = $this
    ->t('Empty value message: @no_empty_message', [
    '@no_empty_message' => $this
      ->getSetting('no_empty_message'),
  ]);
  return $summary;
}