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

Breadcrumb

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

function UrlMatcher::handleRouteRequirements

Handles specific route requirements.

Return value

array The first element represents the status, the second contains additional information

3 calls to UrlMatcher::handleRouteRequirements()
Router::doMatchCollection in core/lib/Drupal/Core/Routing/Router.php
Tries to match a URL with a set of routes.
TraceableUrlMatcher::matchCollection in vendor/symfony/routing/Matcher/TraceableUrlMatcher.php
Tries to match a URL with a set of routes.
UrlMatcher::matchCollection in vendor/symfony/routing/Matcher/UrlMatcher.php
Tries to match a URL with a set of routes.

File

vendor/symfony/routing/Matcher/UrlMatcher.php, line 212

Class

UrlMatcher
UrlMatcher matches URL based on a set of routes.

Namespace

Symfony\Component\Routing\Matcher

Code

protected function handleRouteRequirements(string $pathinfo, string $name, Route $route, array $routeParameters) : array {
    // expression condition
    if ($route->getCondition() && !$this->getExpressionLanguage()
        ->evaluate($route->getCondition(), [
        'context' => $this->context,
        'request' => $this->request ?: $this->createRequest($pathinfo),
        'params' => $routeParameters,
    ])) {
        return [
            self::REQUIREMENT_MISMATCH,
            null,
        ];
    }
    return [
        self::REQUIREMENT_MATCH,
        null,
    ];
}

API Navigation

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