function RouteTestSubscriber::alterRoutes
Same name in other branches
- 9 core/modules/system/tests/modules/router_test_directory/src/RouteTestSubscriber.php \Drupal\router_test\RouteTestSubscriber::alterRoutes()
- 8.9.x core/modules/system/tests/modules/router_test_directory/src/RouteTestSubscriber.php \Drupal\router_test\RouteTestSubscriber::alterRoutes()
- 10 core/modules/system/tests/modules/router_test_directory/src/RouteTestSubscriber.php \Drupal\router_test\RouteTestSubscriber::alterRoutes()
Overrides RouteSubscriberBase::alterRoutes
File
-
core/
modules/ system/ tests/ modules/ router_test_directory/ src/ RouteTestSubscriber.php, line 18
Class
- RouteTestSubscriber
- Listens to the dynamic route event and add a test route.
Namespace
Drupal\router_testCode
protected function alterRoutes(RouteCollection $collection) {
$route = $collection->get('router_test.6');
// Change controller method from test1 to test5.
$route->setDefault('_controller', '\\Drupal\\router_test\\TestControllers::test5');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.