RouteSubscriber::alterRoutes

protected RouteSubscriber::alterRoutes(RouteCollection $collection)

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/config_translation/src/Routing/RouteSubscriber.php, line 35

Class

RouteSubscriber
Listens to the dynamic route events.

Namespace

Drupal\config_translation\Routing

Code

protected function alterRoutes(RouteCollection $collection) {
  $mappers = $this->mapperManager->getMappers($collection);

  foreach ($mappers as $mapper) {
    $collection->add($mapper->getOverviewRouteName(), $mapper->getOverviewRoute());
    $collection->add($mapper->getAddRouteName(), $mapper->getAddRoute());
    $collection->add($mapper->getEditRouteName(), $mapper->getEditRoute());
    $collection->add($mapper->getDeleteRouteName(), $mapper->getDeleteRoute());
  }
}
doc_Drupal
2016-10-29 09:39:26
Comments
Leave a Comment

Please login to continue.