function Router::applyRouteEnhancers

Same name and namespace in other branches
  1. 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.

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

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