You are here

class RouteSubscriber in Media Expire 8

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

Listens to the dynamic route events.

Hierarchy

Expanded class hierarchy of RouteSubscriber

1 string reference to 'RouteSubscriber'
media_expire.services.yml in ./media_expire.services.yml
media_expire.services.yml
1 service uses RouteSubscriber
media_expire.route_subscriber in ./media_expire.services.yml
Drupal\media_expire\Routing\RouteSubscriber

File

src/Routing/RouteSubscriber.php, line 11

Namespace

Drupal\media_expire\Routing
View source
class RouteSubscriber extends RouteSubscriberBase {

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

}

Members

Namesort descending Modifiers Type Description Overrides
RouteSubscriber::alterRoutes public function Alters existing routes for a specific collection. Overrides RouteSubscriberBase::alterRoutes
RouteSubscriberBase::getSubscribedEvents public static function Returns an array of event names this subscriber wants to listen to. 5
RouteSubscriberBase::onAlterRoutes public function Delegates the route altering to self::alterRoutes(). 1