You are here

protected static function Select2::setAutocompleteRouteParameters in Select 2 8

Sets the autocomplete route parameters.

Parameters

array $element: The render element.

Return value

array The render element with autocomplete route parameters.

File

src/Element/Select2.php, line 355

Class

Select2
Provides an select2 form element.

Namespace

Drupal\select2\Element

Code

protected static function setAutocompleteRouteParameters(array &$element) {
  $complete_form = [];
  $element = EntityAutocomplete::processEntityAutocomplete($element, new FormState(), $complete_form);
  $element['#autocomplete_route_name'] = 'select2.entity_autocomplete';
  return $element;
}