You are here

protected function Router::applyRouteEnhancers in Drupal 10

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Routing/Router.php \Drupal\Core\Routing\Router::applyRouteEnhancers()
  2. 9 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.

File

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

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;
}