Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Router.php

function Router::matchCollection

Overrides UrlMatcher::matchCollection

1 call to Router::matchCollection()
Router::matchRequest in core/lib/Drupal/Core/Routing/Router.php
Tries to match a request with a set of routes.

File

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

Class

Router
Router implementation in Drupal.

Namespace

Drupal\Core\Routing

Code

protected function matchCollection($pathinfo, RouteCollection $routes) : array {
    // Try a case-sensitive match.
    $match = $this->doMatchCollection($pathinfo, $routes, TRUE);
    // Try a case-insensitive match.
    if ($match === NULL && $routes->count() > 0) {
        $match = $this->doMatchCollection($pathinfo, $routes, FALSE);
    }
    if ($match === NULL) {
        throw 0 < count($this->allow) ? new MethodNotAllowedException(array_unique($this->allow)) : new ResourceNotFoundException(sprintf('No routes found for "%s".', $this->currentPath
            ->getPath()));
    }
    return $match;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal