protected function RouteSubscriber::alterRoutes in Menu Item Extras 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/ RouteSubscriber.php, line 19
Class
- RouteSubscriber
- Class RouteSubscriber.
Namespace
Drupal\menu_item_extras\RoutingCode
protected function alterRoutes(RouteCollection $collection) {
$route = $collection
->get('entity.menu.add_link_form');
if ($route) {
$route
->setDefault('_controller', MenuController::class . '::addLink');
}
}