You are here

public function UrlMatcher::finalMatch in Drupal 9

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Routing/UrlMatcher.php \Drupal\Core\Routing\UrlMatcher::finalMatch()

File

core/lib/Drupal/Core/Routing/UrlMatcher.php, line 36

Class

UrlMatcher
Drupal-specific URL Matcher; handles the Drupal "system path" mapping.

Namespace

Drupal\Core\Routing

Code

public function finalMatch(RouteCollection $collection, Request $request) {
  $this->routes = $collection;
  $context = new RequestContext();
  $context
    ->fromRequest($request);
  $this
    ->setContext($context);
  return $this
    ->match($this->currentPath
    ->getPath($request));
}