You are here

public function DisplayInterface::displayEntityBrowser in Entity Browser 8

Same name and namespace in other branches
  1. 8.2 src/DisplayInterface.php \Drupal\entity_browser\DisplayInterface::displayEntityBrowser()

Displays entity browser.

This is the "entry point" for every non-entity browser code to interact with it. It will take care about displaying entity browser in one way or another.

Parameters

array $element: A form element array containing basic properties for the entity browser element:

  • #eb_parents: The 'parents' space for the field in the form.

\Drupal\Core\Form\FormStateInterface $form_state: The form state object.

array $complete_form: The form structure where entity browser is being attached to.

array $persistent_data: (optional) Extra information to send to the Entity Browser Widget. This is needed as the widget may display after a new bootstrap, which would discard the current form state. Arbitrary values can be added and used by widgets, if needed. The expected array keys are "selected_entities" and "validators".

  • Drupal\Core\Entity\EntityInterface[] selected_entities An array of currently selected entities.
  • array validators An associative array mapping EntityBrowserWidgetValidation IDs to an array of options to pass to the plugin's validate method.

Return value

array A render array.

1 method overrides DisplayInterface::displayEntityBrowser()
DisplayBase::displayEntityBrowser in src/DisplayBase.php
Displays entity browser.

File

src/DisplayInterface.php, line 61

Class

DisplayInterface
Defines the interface for entity browser displays.

Namespace

Drupal\entity_browser

Code

public function displayEntityBrowser(array $element, FormStateInterface $form_state, array &$complete_form, array $persistent_data = []);