Webiny\Component\Router\Router::match PHP Метод

match() публичный Метод

Tries to match the given url against current RouteCollection.
public match ( string | UrlObject $url ) : MatchedRoute | boolean
$url string | Webiny\Component\StdLib\StdObject\UrlObject\UrlObject Url to match.
Результат Webiny\Component\Router\Matcher\MatchedRoute | boolean MatchedRoute instance is returned if url was matched. Otherwise false is returned.
    public function match($url)
    {
        if ($this->isString($url)) {
            $url = $this->url($url);
        } else {
            $url = StdObjectWrapper::isUrlObject($url) ? $url : $this->url('');
        }
        // get it from cache
        if (($result = $this->loadFromCache('match.' . $url->val())) !== false) {
            return $this->unserialize($result);
        }
        // try to match the url
        $result = $this->urlMatcher->match($url);
        // cache it
        $cacheResult = $this->isArray($result) ? $this->serialize($result) : $result;
        $this->saveToCache('match.' . $url->val(), $cacheResult);
        return $result;
    }