class UrlMatcher

Drupal-specific URL Matcher; handles the Drupal "system path" mapping.

Hierarchy

Expanded class hierarchy of UrlMatcher

1 string reference to 'UrlMatcher'
core.services.yml in drupal/core/core.services.yml
drupal/core/core.services.yml

File

drupal/core/lib/Drupal/Core/Routing/UrlMatcher.php, line 18
Contains Drupal\Core\Routing\UrlMatcher.

Namespace

Drupal\Core\Routing
View source
class UrlMatcher extends BaseUrlMatcher {

  /**
   * Constructs a new UrlMatcher.
   *
   * The parent class has a constructor we need to skip, so just override it
   * with a no-op.
   */
  public function __construct() {
  }
  public function finalMatch(RouteCollection $collection, Request $request) {
    $this->routes = $collection;
    $context = new RequestContext();
    $context
      ->fromRequest($request);
    $this
      ->setContext($context);
    return $this
      ->match('/' . $request->attributes
      ->get('system_path'));
  }

}

Members

Namesort descending Modifiers Type Description Overrides
UrlMatcher::$allow protected property
UrlMatcher::$context protected property
UrlMatcher::$routes protected property
UrlMatcher::finalMatch public function Matches a request against a route collection and returns exactly one result. Overrides UrlMatcher::finalMatch
UrlMatcher::getAttributes protected function Returns an array of values to use as request attributes. Overrides UrlMatcher::getAttributes
UrlMatcher::getContext public function Gets the request context. Overrides RequestContextAwareInterface::getContext
UrlMatcher::handleRouteRequirements protected function Handles specific route requirements. 1
UrlMatcher::match public function Tries to match a URL path with a set of routes. Overrides UrlMatcherInterface::match 5
UrlMatcher::matchCollection protected function Tries to match a URL with a set of routes. 1
UrlMatcher::mergeDefaults protected function Get merged default parameters.
UrlMatcher::REQUIREMENT_MATCH constant
UrlMatcher::REQUIREMENT_MISMATCH constant
UrlMatcher::ROUTE_MATCH constant
UrlMatcher::setContext public function Sets the request context. Overrides RequestContextAwareInterface::setContext
UrlMatcher::__construct public function Constructs a new UrlMatcher. Overrides UrlMatcher::__construct