You are here

protected function RouteSubscriber::alterRoutes in Redirect 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/Routing/RouteSubscriber.php, line 16

Class

RouteSubscriber
Modify core routes to support redirect.

Namespace

Drupal\redirect\Routing

Code

protected function alterRoutes(RouteCollection $collection) {
  if ($route = $collection
    ->get('image.style_public')) {
    $route
      ->setDefault('_disable_route_normalizer', TRUE);
  }
  if ($route = $collection
    ->get('image.style_private')) {
    $route
      ->setDefault('_disable_route_normalizer', TRUE);
  }
  if ($route = $collection
    ->get('system.files')) {
    $route
      ->setDefault('_disable_route_normalizer', TRUE);
  }
}