function Router::applyRouteEnhancers

Same name in other branches
  1. 9 core/lib/Drupal/Core/Routing/Router.php \Drupal\Core\Routing\Router::applyRouteEnhancers()
  2. 8.9.x core/lib/Drupal/Core/Routing/Router.php \Drupal\Core\Routing\Router::applyRouteEnhancers()
  3. 11.x 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 268

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

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