public function AccessAwareRouter::matchRequest in Drupal 9
Same name and namespace in other branches
- 8 core/lib/Drupal/Core/Routing/AccessAwareRouter.php \Drupal\Core\Routing\AccessAwareRouter::matchRequest()
- 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 91
Class
- AccessAwareRouter
- A router class for Drupal with access check and upcasting.
Namespace
Drupal\Core\RoutingCode
public function matchRequest(Request $request) {
$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();
}