You are here

public function RouteSubscriber::alterRoutes in Media Expire 8

Same name and namespace in other branches
  1. 8.2 src/Routing/RouteSubscriber.php \Drupal\media_expire\Routing\RouteSubscriber::alterRoutes()

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
Listens to the dynamic route events.

Namespace

Drupal\media_expire\Routing

Code

public function alterRoutes(RouteCollection $collection) {
  if ($route = $collection
    ->get('entity.media.canonical')) {
    $route
      ->setDefault('_controller', 'Drupal\\media_expire\\Controller\\MediaViewController::view');
  }
}