public function AutocompleteRouteSubscriber::alterRoutes in Opigno Learning path 3.x
Same name and namespace in other branches
- 8 modules/opigno_alter_entity_autocomplete/src/Routing/AutocompleteRouteSubscriber.php \Drupal\opigno_alter_entity_autocomplete\Routing\AutocompleteRouteSubscriber::alterRoutes()
Alters route.
Parameters
\Symfony\Component\Routing\RouteCollection $collection: Routes.
Overrides RouteSubscriberBase::alterRoutes
File
- modules/
opigno_alter_entity_autocomplete/ src/ Routing/ AutocompleteRouteSubscriber.php, line 19
Class
- AutocompleteRouteSubscriber
- Class AutocompleteRouteSubscriber.
Namespace
Drupal\opigno_alter_entity_autocomplete\RoutingCode
public function alterRoutes(RouteCollection $collection) {
if ($route = $collection
->get('system.entity_autocomplete')) {
$route
->setDefault('_controller', '\\Drupal\\opigno_alter_entity_autocomplete\\Controller\\EntityAutocompleteController::handleAutocomplete');
}
}