public function RouteTestSubscriber::dynamicRoutes

Adds a dynamic test route.

Parameters

\Drupal\Core\Routing\RouteBuildEvent $event: The route building event.

File

drupal/core/modules/system/tests/modules/router_test/lib/Drupal/router_test/RouteTestSubscriber.php, line 34

Class

RouteTestSubscriber
Listens to the dynamic route event and add a test route.

Namespace

Drupal\router_test

Code

public function dynamicRoutes(RouteBuildEvent $event) {
  $collection = $event
    ->getRouteCollection();
  $route = new Route('/router_test/test5', array(
    '_content' => '\\Drupal\\router_test\\TestControllers::test5',
  ), array(
    '_access' => 'TRUE',
  ));
  $collection
    ->add('router_test_5', $route);
}