You are here

protected function RouteSubscriber::alterRoutes in Taxonomy Views Integrator 8

Alters existing routes for a specific collection.

Parameters

\Symfony\Component\Routing\RouteCollection $collection: The route collection for adding routes.

Overrides RouteSubscriberBase::alterRoutes

File

src/EventSubscriber/RouteSubscriber.php, line 24

Class

RouteSubscriber
Alters the route for using Taxonomy Views Integrator.

Namespace

Drupal\tvi\EventSubscriber

Code

protected function alterRoutes(RouteCollection $collection) {

  // Update the term router to use the TVI controller.
  if ($route = $collection
    ->get('entity.taxonomy_term.canonical')) {
    $route
      ->setDefault('_controller', '\\Drupal\\tvi\\Controller\\TaxonomyViewsIntegratorTermPageController::render');
  }
}