RouteSubscriber.php in Commerce Cart API 8
File
tests/modules/commerce_cart_reactjs/src/Routing/RouteSubscriber.php
View source
<?php
namespace Drupal\commerce_cart_reactjs\Routing;
use Drupal\Core\Routing\RouteSubscriberBase;
use Symfony\Component\Routing\RouteCollection;
class RouteSubscriber extends RouteSubscriberBase {
protected function alterRoutes(RouteCollection $collection) {
$route = $collection
->get('commerce_cart.page');
if ($route) {
$route
->setDefault('_controller', '\\Drupal\\commerce_cart_reactjs\\Controller\\CartController::cartPage');
}
}
}