function AccessAwareRouter::matchRequest

Same name in other branches
  1. 9 core/lib/Drupal/Core/Routing/AccessAwareRouter.php \Drupal\Core\Routing\AccessAwareRouter::matchRequest()
  2. 8.9.x core/lib/Drupal/Core/Routing/AccessAwareRouter.php \Drupal\Core\Routing\AccessAwareRouter::matchRequest()
  3. 10 core/lib/Drupal/Core/Routing/AccessAwareRouter.php \Drupal\Core\Routing\AccessAwareRouter::matchRequest()

Throws

\Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException Thrown when access checking failed.

Overrides AccessAwareRouterInterface::matchRequest

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

File

core/lib/Drupal/Core/Routing/AccessAwareRouter.php, line 86

Class

AccessAwareRouter
A router class for Drupal with access check and upcasting.

Namespace

Drupal\Core\Routing

Code

public function matchRequest(Request $request) : array {
    $parameters = $this->router
        ->matchRequest($request);
    $request->attributes
        ->add($parameters);
    $this->checkAccess($request);
    // We can not return $parameters because the access check can change the
    // request attributes.
    return $request->attributes
        ->all();
}

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