You are here

protected function Router::applyRouteEnhancers in Drupal 9

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Routing/Router.php \Drupal\Core\Routing\Router::applyRouteEnhancers()

Apply the route enhancers to the defaults, according to priorities.

Parameters

array $defaults: The defaults coming from the final matched route.

\Symfony\Component\HttpFoundation\Request $request: The request.

Return value

array The request attributes after applying the enhancers. This might consist raw values from the URL but also upcasted values, like entity objects, from route enhancers.

1 call to Router::applyRouteEnhancers()
Router::matchRequest in core/lib/Drupal/Core/Routing/Router.php

File

core/lib/Drupal/Core/Routing/Router.php, line 254

Class

Router
Router implementation in Drupal.

Namespace

Drupal\Core\Routing

Code

protected function applyRouteEnhancers($defaults, Request $request) {
  foreach ($this->enhancers as $enhancer) {
    $defaults = $enhancer
      ->enhance($defaults, $request);
  }
  return $defaults;
}