public function UrlMatcher::finalMatch

Same name in this branch
  1. 8.x drupal/core/lib/Drupal/Core/Routing/UrlMatcher.php \Drupal\Core\Routing\UrlMatcher::finalMatch()
  2. 8.x drupal/core/vendor/symfony-cmf/routing/Symfony/Cmf/Component/Routing/NestedMatcher/UrlMatcher.php \Symfony\Cmf\Component\Routing\NestedMatcher\UrlMatcher::finalMatch()

Matches a request against a route collection and returns exactly one result.

Parameters

RouteCollection $collection The collection against which to match.:

Request $request The request to match.:

Return value

array An array of parameters

Throws

ResourceNotFoundException if none of the routes in $collection matches $request

Overrides FinalMatcherInterface::finalMatch

1 method overrides UrlMatcher::finalMatch()
UrlMatcher::finalMatch in drupal/core/lib/Drupal/Core/Routing/UrlMatcher.php
Matches a request against a route collection and returns exactly one result.

File

drupal/core/vendor/symfony-cmf/routing/Symfony/Cmf/Component/Routing/NestedMatcher/UrlMatcher.php, line 25

Class

UrlMatcher
Extended UrlMatcher to provide an additional interface and enhanced features.

Namespace

Symfony\Cmf\Component\Routing\NestedMatcher

Code

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