src/View/Helper/UrlComparerTrait.php
protected function _matchRelative($url) {
        $relative = $this->_relative();
        if (!$relative) {
            return true;
        }
        $components = parse_url($url);
        if (!isset($components['host'])) {
            return true;
        }
        $path = trim($components['path'], '/');
        return strpos($path, $relative) === 0;
    }
protected function _matchRelative($url) {
        $relative = $this->_relative();
        if (!$relative) {
            return true;
        }
        $components = parse_url($url);
        if (!isset($components['host'])) {
            return true;
        }
        $path = trim($components['path'], '/');
        return strpos($path, $relative) === 0;
    }
protected function _matchRelative ( $ url ) { $ relative = $ this -> _relative ( ) ; if ( ! $ relative ) { return true ; } $ components = parse_url ( $ url ) ; if ( ! isset ( $ components [ 'host' ] ) ) { return true ; } $ path = trim ( $ components [ 'path' ] , '/' ) ; return strpos ( $ path , $ relative ) === 0 ; }
Checks if the given URL components match the current relative URL. This
methods only works with full URL, and do not check the host.

@param string $url URL to check.

@return bool `true` if the URL matches, `false` otherwise.
Checks if the given URL components match the current relative URL . This methods only works with full URL and do not check the host .