src/Library/Helper/Url.php
public static function url($param = null, $value = null, $url = null)
    {
        if (is_null($param)) {
            return '';
        }
        if (is_null($url) || !strlen($url)) {
            $url = self::getRequestUrl();
        }

        if (!is_null($param)) {
            if (is_array($param) && is_null($value)) {
                foreach($param as $param_p=>$value_p) {
                    $url = self::setParameter($param_p, $value_p, $url);
                }
            } elseif (is_null($value)) {
                $parsed_url = self::parse($url);
                if (isset($parsed_url['params']) && isset($parsed_url['params'][$param])) {
                    return $parsed_url['params'][$param];
                }
                return false;
            } elseif (!is_null($value)) {
                $url = self::setParameter($param, $value, $url);
            }
        }

        return self::build(self::parse($url));
    }
public static function url($param = null, $value = null, $url = null)
    {
        if (is_null($param)) {
            return '';
        }
        if (is_null($url) || !strlen($url)) {
            $url = self::getRequestUrl();
        }

        if (!is_null($param)) {
            if (is_array($param) && is_null($value)) {
                foreach($param as $param_p=>$value_p) {
                    $url = self::setParameter($param_p, $value_p, $url);
                }
            } elseif (is_null($value)) {
                $parsed_url = self::parse($url);
                if (isset($parsed_url['params']) && isset($parsed_url['params'][$param])) {
                    return $parsed_url['params'][$param];
                }
                return false;
            } elseif (!is_null($value)) {
                $url = self::setParameter($param, $value, $url);
            }
        }

        return self::build(self::parse($url));
    }
public static function url ( $ param = null , $ value = null , $ url = null ) { if ( is_null ( $ param ) ) { return '' ; } if ( is_null ( $ url ) || ! strlen ( $ url ) ) { $ url = self :: getRequestUrl ( ) ; } if ( ! is_null ( $ param ) ) { if ( is_array ( $ param ) && is_null ( $ value ) ) { foreach ( $ param as $ param_p => $ value_p ) { $ url = self :: setParameter ( $ param_p , $ value_p , $ url ) ; } } elseif ( is_null ( $ value ) ) { $ parsed_url = self :: parse ( $ url ) ; if ( isset ( $ parsed_url [ 'params' ] ) && isset ( $ parsed_url [ 'params' ] [ $ param ] ) ) { return $ parsed_url [ 'params' ] [ $ param ] ; } return false ; } elseif ( ! is_null ( $ value ) ) { $ url = self :: setParameter ( $ param , $ value , $ url ) ; } } return self :: build ( self :: parse ( $ url ) ) ; }
Global URL builder

@param string/array/null $param A parameter to set, or an array like `param => value` to set in URL
@param string/null $value The value of the `$param` argument (if it is a string)
@param string/null $url The URL to work on (`self::getRequestUrl()` by default)
@return string The final rebuilt URL
Global URL builder