You are here

protected function RouteSubscriber::alterRoutes in Default Content 8

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/RouteSubscriber.php, line 24
Contains \Drupal\defaultcontent\Routing\RouteSubscriber.

Class

RouteSubscriber
Subscriber for Devel routes.

Namespace

Drupal\defaultcontent\Routing

Code

protected function alterRoutes(RouteCollection $collection) {
  $route = new Route('node/{node}/convert', [
    '_controller' => '\\Drupal\\defaultcontent\\Export::export',
    '_title_callback' => '\\Drupal\\defaultcontent\\Export::title',
  ], [
    '_permission' => 'access devel information',
  ], [
    '_admin_route' => TRUE,
  ]);
  $collection
    ->add("entity.node.convert", $route);
}