You are here

protected function EntityReferenceDragDropWidget::selectedOptionsToRenderableArray in Entity Reference Drag & Drop 2.x

Same name and namespace in other branches
  1. 8 src/Plugin/Field/FieldWidget/EntityReferenceDragDropWidget.php \Drupal\entityreference_dragdrop\Plugin\Field\FieldWidget\EntityReferenceDragDropWidget::selectedOptionsToRenderableArray()

Converts list of selected options to renderable array.

Parameters

array $options:

$key:

Return value

array

1 call to EntityReferenceDragDropWidget::selectedOptionsToRenderableArray()
EntityReferenceDragDropWidget::formElement in src/Plugin/Field/FieldWidget/EntityReferenceDragDropWidget.php
Returns the form for a single field widget.

File

src/Plugin/Field/FieldWidget/EntityReferenceDragDropWidget.php, line 304

Class

EntityReferenceDragDropWidget
Plugin implementation of the 'entityreference_dragdrop' widget.

Namespace

Drupal\entityreference_dragdrop\Plugin\Field\FieldWidget

Code

protected function selectedOptionsToRenderableArray(array $options, $key) {
  return $this
    ->optionsToRenderableArray($options, $key, $this
    ->getSetting('selected_entities_label'), [
    'entityreference-dragdrop-selected',
  ], [
    'entityreference-dragdrop-container-selected',
  ]);
}