You are here

public function UrlMatcher::finalMatch in Zircon Profile 8

Same name in this branch
  1. 8 vendor/symfony-cmf/routing/NestedMatcher/UrlMatcher.php \Symfony\Cmf\Component\Routing\NestedMatcher\UrlMatcher::finalMatch()
  2. 8 core/lib/Drupal/Core/Routing/UrlMatcher.php \Drupal\Core\Routing\UrlMatcher::finalMatch()
Same name and namespace in other branches
  1. 8.0 vendor/symfony-cmf/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 core/lib/Drupal/Core/Routing/UrlMatcher.php
Matches a request against a route collection and returns exactly one result.

File

vendor/symfony-cmf/routing/NestedMatcher/UrlMatcher.php, line 34

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