protected function RouteSubscriber::alterRoutes in Zircon Profile 8
Same name in this branch
- 8 core/modules/views/src/EventSubscriber/RouteSubscriber.php \Drupal\views\EventSubscriber\RouteSubscriber::alterRoutes()
- 8 core/modules/node/src/Routing/RouteSubscriber.php \Drupal\node\Routing\RouteSubscriber::alterRoutes()
- 8 core/modules/config_translation/src/Routing/RouteSubscriber.php \Drupal\config_translation\Routing\RouteSubscriber::alterRoutes()
- 8 core/modules/field_ui/src/Routing/RouteSubscriber.php \Drupal\field_ui\Routing\RouteSubscriber::alterRoutes()
Same name and namespace in other branches
- 8.0 core/modules/node/src/Routing/RouteSubscriber.php \Drupal\node\Routing\RouteSubscriber::alterRoutes()
Alters existing routes for a specific collection.
Parameters
\Symfony\Component\Routing\RouteCollection $collection: The route collection for adding routes.
Overrides RouteSubscriberBase::alterRoutes
File
- core/
modules/ node/ src/ Routing/ RouteSubscriber.php, line 21 - Contains \Drupal\node\Routing\RouteSubscriber.
Class
- RouteSubscriber
- Listens to the dynamic route events.
Namespace
Drupal\node\RoutingCode
protected function alterRoutes(RouteCollection $collection) {
// As nodes are the primary type of content, the node listing should be
// easily available. In order to do that, override admin/content to show
// a node listing instead of the path's child links.
$route = $collection
->get('system.admin_content');
if ($route) {
$route
->setDefaults(array(
'_title' => 'Content',
'_entity_list' => 'node',
));
$route
->setRequirements(array(
'_permission' => 'access content overview',
));
}
}