protected function RouteSubscriber::alterRoutes in Commerce Cart API 8
Alters existing routes for a specific collection.
Parameters
\Symfony\Component\Routing\RouteCollection $collection: The route collection for adding routes.
Overrides RouteSubscriberBase::alterRoutes
File
- tests/
modules/ commerce_cart_reactjs/ src/ Routing/ RouteSubscriber.php, line 18
Class
- RouteSubscriber
- Class RouteSubscriber.
Namespace
Drupal\commerce_cart_reactjs\RoutingCode
protected function alterRoutes(RouteCollection $collection) {
$route = $collection
->get('commerce_cart.page');
if ($route) {
$route
->setDefault('_controller', '\\Drupal\\commerce_cart_reactjs\\Controller\\CartController::cartPage');
}
}