function EntityRouteAlterSubscriber::onRoutingRouteAlterSetType

Same name in other branches
  1. 8.9.x core/lib/Drupal/Core/EventSubscriber/EntityRouteAlterSubscriber.php \Drupal\Core\EventSubscriber\EntityRouteAlterSubscriber::onRoutingRouteAlterSetType()
  2. 10 core/lib/Drupal/Core/EventSubscriber/EntityRouteAlterSubscriber.php \Drupal\Core\EventSubscriber\EntityRouteAlterSubscriber::onRoutingRouteAlterSetType()
  3. 11.x core/lib/Drupal/Core/EventSubscriber/EntityRouteAlterSubscriber.php \Drupal\Core\EventSubscriber\EntityRouteAlterSubscriber::onRoutingRouteAlterSetType()

Applies parameter converters to route parameters.

Parameters

\Drupal\Core\Routing\RouteBuildEvent $event: The event to process.

File

core/lib/Drupal/Core/EventSubscriber/EntityRouteAlterSubscriber.php, line 46

Class

EntityRouteAlterSubscriber
Registers the 'type' of route parameter names that match an entity type.

Namespace

Drupal\Core\EventSubscriber

Code

public function onRoutingRouteAlterSetType(RouteBuildEvent $event) {
    foreach ($event->getRouteCollection() as $route) {
        $this->resolverManager
            ->setRouteOptions($route);
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.