You are here

public function ContentBrowserRouteSubscriber::alterRoutes in Content Browser 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/ContentBrowserRouteSubscriber.php, line 16

Class

ContentBrowserRouteSubscriber
Use the frontend theme conditionally for our entity browser.

Namespace

Drupal\content_browser\Routing

Code

public function alterRoutes(RouteCollection $collection) {
  foreach ([
    'entity_browser.browse_content',
    'entity_browser.browse_content_iframe',
  ] as $name) {
    if ($route = $collection
      ->get($name)) {
      $route
        ->setOption('_admin_route', FALSE);
    }
  }
}