You are here

public function AutocompleteRouteSubscriber::alterRoutes in Panopoly Widgets 8.2

Alters existing routes for a specific collection.

Parameters

\Symfony\Component\Routing\RouteCollection $collection: The route collection for adding routes.

Overrides RouteSubscriberBase::alterRoutes

File

src/Routing/AutocompleteRouteSubscriber.php, line 16

Class

AutocompleteRouteSubscriber
Rout subscriber to setup our entity autocomplete controller.

Namespace

Drupal\panopoly_widgets\Routing

Code

public function alterRoutes(RouteCollection $collection) {
  if ($route = $collection
    ->get('system.entity_autocomplete')) {
    $route
      ->setDefault('_controller', '\\Drupal\\panopoly_widgets\\Controller\\EntityAutocompleteController::handleAutocomplete');
  }
}