You are here

class ContentBrowserRouteSubscriber in Content Browser 8

Use the frontend theme conditionally for our entity browser.

Hierarchy

Expanded class hierarchy of ContentBrowserRouteSubscriber

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

File

src/Routing/ContentBrowserRouteSubscriber.php, line 11

Namespace

Drupal\content_browser\Routing
View source
class ContentBrowserRouteSubscriber extends RouteSubscriberBase {

  /**
   * {@inheritdoc}
   */
  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);
      }
    }
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ContentBrowserRouteSubscriber::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