You are here

public function Standalone::displayEntityBrowser in Entity Browser 8.2

Same name and namespace in other branches
  1. 8 src/Plugin/EntityBrowser/Display/Standalone.php \Drupal\entity_browser\Plugin\EntityBrowser\Display\Standalone::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.

Overrides DisplayBase::displayEntityBrowser

File

src/Plugin/EntityBrowser/Display/Standalone.php, line 48

Class

Standalone
Presents entity browser as a standalone form.

Namespace

Drupal\entity_browser\Plugin\EntityBrowser\Display

Code

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

  // @TODO Implement it.
}