You are here

public function EntityReferenceRenderedBase::settingsSummary in Entityreference Rendered Widget 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/EntityReferenceRenderedBase.php, line 145

Class

EntityReferenceRenderedBase
Base class for widgets provided by this module.

Namespace

Drupal\entityreference_rendered_widget\Plugin\Field\FieldWidget

Code

public function settingsSummary() {
  $summary = [];
  $settings = $this
    ->getSettings();
  $display_mode = $settings['display_mode'];
  $label_display = $settings['label_display'];
  $summary[] = $this
    ->t('Display mode: @mode', [
    '@mode' => $this->displayModes[$display_mode]['label'],
  ]);
  $summary[] = $this
    ->t('Label display: @label_display', [
    '@label_display' => $this->labelOptions[$label_display],
  ]);
  return $summary;
}