protected function GroupAdminRouteSubscriber::alterRoutes in Group 8
Same name and namespace in other branches
- 2.0.x src/Routing/GroupAdminRouteSubscriber.php \Drupal\group\Routing\GroupAdminRouteSubscriber::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/ GroupAdminRouteSubscriber.php, line 34
Class
- GroupAdminRouteSubscriber
- Sets the _admin_route for specific group-related routes.
Namespace
Drupal\group\RoutingCode
protected function alterRoutes(RouteCollection $collection) {
if ($this->configFactory
->get('group.settings')
->get('use_admin_theme')) {
foreach ($collection
->all() as $route) {
if ($route
->hasOption('_group_operation_route')) {
$route
->setOption('_admin_route', TRUE);
}
}
}
}