You are here

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.
 *
 * Listens to the dynamic route events.
 */
class RouteSubscriber extends RouteSubscriberBase {

  /**
   * {@inheritdoc}
   */
  protected function alterRoutes(RouteCollection $collection) {
    $route = $collection
      ->get('commerce_cart.page');
    if ($route) {
      $route
        ->setDefault('_controller', '\\Drupal\\commerce_cart_reactjs\\Controller\\CartController::cartPage');
    }
  }

}

Classes

Namesort descending Description
RouteSubscriber Class RouteSubscriber.