public function AutocompleteRouteSubscriber::alterRoutes in Panopoly 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
- modules/
panopoly/ panopoly_widgets/ src/ Routing/ AutocompleteRouteSubscriber.php, line 16
Class
- AutocompleteRouteSubscriber
- Rout subscriber to setup our entity autocomplete controller.
Namespace
Drupal\panopoly_widgets\RoutingCode
public function alterRoutes(RouteCollection $collection) {
if ($route = $collection
->get('system.entity_autocomplete')) {
$route
->setDefault('_controller', '\\Drupal\\panopoly_widgets\\Controller\\EntityAutocompleteController::handleAutocomplete');
}
}