You are here

protected function DefaultRouteSubscriber::alterRoutes in Form mode manager 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/EventSubscriber/DefaultRouteSubscriber.php, line 57

Class

DefaultRouteSubscriber
Subscriber for form_mode_manager routes.

Namespace

Drupal\form_mode_manager\Routing\EventSubscriber

Code

protected function alterRoutes(RouteCollection $collection) {
  $form_modes_definitions = $this->formModeManager
    ->getAllFormModesDefinitions();
  foreach (array_keys($form_modes_definitions) as $entity_type_id) {
    $entity_type = $this->entityTypeManager
      ->getDefinition($entity_type_id);
    $this
      ->enhanceDefaultRoutes($collection, $entity_type
      ->id());
  }
}