You are here

protected function RouteSubscriber::alterRoutes in Opigno forum 3.x

Same name and namespace in other branches
  1. 8 src/Routing/RouteSubscriber.php \Drupal\opigno_forum\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\opigno_forum\Routing

Code

protected function alterRoutes(RouteCollection $collection) {
  if (($route = $collection
    ->get('forum.page')) !== NULL) {
    $route
      ->setRequirement('_forum_access_check', '_forum_access_check');
  }
}