function Router::matchRequest

Same name in other branches
  1. 9 core/lib/Drupal/Core/Routing/Router.php \Drupal\Core\Routing\Router::matchRequest()
  2. 8.9.x core/lib/Drupal/Core/Routing/Router.php \Drupal\Core\Routing\Router::matchRequest()
  3. 10 core/lib/Drupal/Core/Routing/Router.php \Drupal\Core\Routing\Router::matchRequest()
1 call to Router::matchRequest()
Router::match in core/lib/Drupal/Core/Routing/Router.php

File

core/lib/Drupal/Core/Routing/Router.php, line 109

Class

Router
Router implementation in Drupal.

Namespace

Drupal\Core\Routing

Code

public function matchRequest(Request $request) : array {
    $collection = $this->getInitialRouteCollection($request);
    if ($collection->count() === 0) {
        throw new ResourceNotFoundException(sprintf('No routes found for "%s".', $this->currentPath
            ->getPath()));
    }
    $collection = $this->applyRouteFilters($collection, $request);
    $collection = $this->applyFitOrder($collection);
    $ret = $this->matchCollection(rawurldecode($this->currentPath
        ->getPath($request)), $collection);
    return $this->applyRouteEnhancers($ret, $request);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.