class ContentBrowserRouteSubscriber in Content Browser 8
Use the frontend theme conditionally for our entity browser.
Hierarchy
- class \Drupal\Core\Routing\RouteSubscriberBase implements \Symfony\Component\EventDispatcher\EventSubscriberInterface
- class \Drupal\content_browser\Routing\ContentBrowserRouteSubscriber
Expanded class hierarchy of ContentBrowserRouteSubscriber
1 string reference to 'ContentBrowserRouteSubscriber'
1 service uses ContentBrowserRouteSubscriber
File
- src/
Routing/ ContentBrowserRouteSubscriber.php, line 11
Namespace
Drupal\content_browser\RoutingView 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
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ContentBrowserRouteSubscriber:: |
public | function |
Alters existing routes for a specific collection. Overrides RouteSubscriberBase:: |
|
RouteSubscriberBase:: |
public static | function | Returns an array of event names this subscriber wants to listen to. | 5 |
RouteSubscriberBase:: |
public | function | Delegates the route altering to self::alterRoutes(). | 1 |