You are here

public function DefaultRouteSubscriber::routeEnhancer in Form mode manager 8

Add required parameters on route basis.

Parameters

\Symfony\Component\Routing\Route $route: The route object of entity.

string $entity_type_id: The ID of the entity type.

Return value

\Symfony\Component\Routing\Route The route enhanced.

3 calls to DefaultRouteSubscriber::routeEnhancer()
DefaultRouteSubscriber::enhanceDefaultAddPageRoutes in src/Routing/EventSubscriber/DefaultRouteSubscriber.php
Enhance entity operation routes add_page.
DefaultRouteSubscriber::enhanceDefaultAddRoutes in src/Routing/EventSubscriber/DefaultRouteSubscriber.php
Enhance entity operation routes add.
DefaultRouteSubscriber::enhanceDefaultEditRoutes in src/Routing/EventSubscriber/DefaultRouteSubscriber.php
Enhance entity operation routes edit.

File

src/Routing/EventSubscriber/DefaultRouteSubscriber.php, line 135

Class

DefaultRouteSubscriber
Subscriber for form_mode_manager routes.

Namespace

Drupal\form_mode_manager\Routing\EventSubscriber

Code

public function routeEnhancer(Route $route, $entity_type_id) {
  $route
    ->setRequirement('_permission', "use {$entity_type_id}.default form mode");
  return $route;
}