public function NestedMatcher::matchRequest

Tries to match a request with a set of routes.

If the matcher can not find information, it must throw one of the exceptions documented below.

Parameters

\Symfony\Component\HttpFoundation\Request $request: The request to match.

Return value

array An array of parameters.

Throws

ResourceNotFoundException If no matching resource could be found.

MethodNotAllowedException If a matching resource was found but the request method is not allowed.

Overrides RequestMatcherInterface::matchRequest

File

drupal/core/lib/Drupal/Core/Routing/NestedMatcher.php, line 127
Definition of Drupal\Core\Routing\NestedMatcher.

Class

NestedMatcher
The nested matcher layers multiple partial matchers together.

Namespace

Drupal\Core\Routing

Code

public function matchRequest(Request $request) {
  $collection = $this->initialMatcher
    ->matchRequestPartial($request);
  foreach ($this
    ->getPartialMatchers() as $matcher) {
    if ($collection) {
      $matcher
        ->setCollection($collection);
    }
    $collection = $matcher
      ->matchRequestPartial($request);
  }
  $attributes = $this->finalMatcher
    ->setCollection($collection)
    ->matchRequest($request);
  return $attributes;
}