src/View/Helper/UrlComparerTrait.php
protected function _normalize($url, array $parts = []) {
        if (!is_string($url)) {
            $url = Router::url($url);
        }
        if (!$this->_matchHost($url)) {
            return null;
        }
        if (!$this->_matchRelative($url)) {
            return null;
        }
        $url = Router::parseRequest(new ServerRequest($this->_removeRelative($url)));
        $arr = [];
        foreach ($this->_parts as $part) {
            if (!isset($url[$part]) || (isset($parts[$part]) && !$parts[$part])) {
                continue;
            }
            if (is_array($url[$part])) {
                $url[$part] = implode('/', $url[$part]);
            }
            if ($part != 'pass') {
                $url[$part] = strtolower($url[$part]);
            }
            $arr[] = $url[$part];
        }
        return $this->_removeRelative(Router::normalize('/'.implode('/', $arr)));
    }
protected function _normalize($url, array $parts = []) {
        if (!is_string($url)) {
            $url = Router::url($url);
        }
        if (!$this->_matchHost($url)) {
            return null;
        }
        if (!$this->_matchRelative($url)) {
            return null;
        }
        $url = Router::parseRequest(new ServerRequest($this->_removeRelative($url)));
        $arr = [];
        foreach ($this->_parts as $part) {
            if (!isset($url[$part]) || (isset($parts[$part]) && !$parts[$part])) {
                continue;
            }
            if (is_array($url[$part])) {
                $url[$part] = implode('/', $url[$part]);
            }
            if ($part != 'pass') {
                $url[$part] = strtolower($url[$part]);
            }
            $arr[] = $url[$part];
        }
        return $this->_removeRelative(Router::normalize('/'.implode('/', $arr)));
    }
protected function _normalize ( $ url , array $ parts = [ ] ) { if ( ! is_string ( $ url ) ) { $ url = Router :: url ( $ url ) ; } if ( ! $ this -> _matchHost ( $ url ) ) { return null ; } if ( ! $ this -> _matchRelative ( $ url ) ) { return null ; } $ url = Router :: parseRequest ( new ServerRequest ( $ this -> _removeRelative ( $ url ) ) ) ; $ arr = [ ] ; foreach ( $ this -> _parts as $ part ) { if ( ! isset ( $ url [ $ part ] ) || ( isset ( $ parts [ $ part ] ) && ! $ parts [ $ part ] ) ) { continue ; } if ( is_array ( $ url [ $ part ] ) ) { $ url [ $ part ] = implode ( '/' , $ url [ $ part ] ) ; } if ( $ part != 'pass' ) { $ url [ $ part ] = strtolower ( $ url [ $ part ] ) ; } $ arr [ ] = $ url [ $ part ] ; } return $ this -> _removeRelative ( Router :: normalize ( '/' . implode ( '/' , $ arr ) ) ) ; }
Normalize an URL.

@param string $url URL to normalize.
@param array $pass Include pass parameters.

@return string Normalized URL.
Normalize an URL .