You are here

protected function ImceRouteSubscriber::alterRoutes in IMCE 8.2

Same name and namespace in other branches
  1. 8 src/Routing/ImceRouteSubscriber.php \Drupal\imce\Routing\ImceRouteSubscriber::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/ImceRouteSubscriber.php, line 34

Class

ImceRouteSubscriber
Listens to the dynamic route events.

Namespace

Drupal\imce\Routing

Code

protected function alterRoutes(RouteCollection $collection) {

  // Conditionally declare imce.page an admin route.
  if ($route = $collection
    ->get('imce.page')) {
    $config = $this->configFactory
      ->get('imce.settings');
    if ($config
      ->get('admin_theme')) {
      $route
        ->setOption('_admin_route', TRUE);
    }
  }
}