src/Library/Helper/Url.php
public static function build(array $url_components = null, $not_toput = null)
    {
        if (!is_array($url_components)) {
            return null;
        }

        $_ntp = $not_toput ? (is_array($not_toput) ? $not_toput : array($not_toput)) : array();

        if (isset($_urls['params']))
            $_urls['params'] = array_filter($_urls['params']);

        $n_url = 
            ( (isset($url_components['scheme']) && !in_array('scheme', $_ntp)) ? $url_components['scheme'].'://' : 'http://')
            .( (isset($url_components['user']) && !in_array('user', $_ntp)) ? $url_components['user'] : '')
            .( (isset($url_components['pass']) && !in_array('pass', $_ntp)) ? ':'.$url_components['pass'] : '')
            .( ((isset($url_components['user']) && !in_array('user', $_ntp)) || (isset($url_components['pass']) && !in_array('pass', $_ntp))) ? '@' : '')
            .( (isset($url_components['host']) && !in_array('host', $_ntp)) ? $url_components['host'] : '')
            .( (isset($url_components['port']) && !in_array('port', $_ntp)) ? ':'.$url_components['port'] : '')
            .( (isset($url_components['path']) && !in_array('path', $_ntp)) ? $url_components['path'] : '')
            .( (isset($url_components['params']) && !in_array('params', $_ntp)) ? '?'.http_build_query($url_components['params']) : '')
            .( (isset($url_components['hash']) && !in_array('hash', $_ntp)) ? '#'.$url_components['hash'] : '');

        return trim($n_url, '?&');
    }
public static function build(array $url_components = null, $not_toput = null)
    {
        if (!is_array($url_components)) {
            return null;
        }

        $_ntp = $not_toput ? (is_array($not_toput) ? $not_toput : array($not_toput)) : array();

        if (isset($_urls['params']))
            $_urls['params'] = array_filter($_urls['params']);

        $n_url = 
            ( (isset($url_components['scheme']) && !in_array('scheme', $_ntp)) ? $url_components['scheme'].'://' : 'http://')
            .( (isset($url_components['user']) && !in_array('user', $_ntp)) ? $url_components['user'] : '')
            .( (isset($url_components['pass']) && !in_array('pass', $_ntp)) ? ':'.$url_components['pass'] : '')
            .( ((isset($url_components['user']) && !in_array('user', $_ntp)) || (isset($url_components['pass']) && !in_array('pass', $_ntp))) ? '@' : '')
            .( (isset($url_components['host']) && !in_array('host', $_ntp)) ? $url_components['host'] : '')
            .( (isset($url_components['port']) && !in_array('port', $_ntp)) ? ':'.$url_components['port'] : '')
            .( (isset($url_components['path']) && !in_array('path', $_ntp)) ? $url_components['path'] : '')
            .( (isset($url_components['params']) && !in_array('params', $_ntp)) ? '?'.http_build_query($url_components['params']) : '')
            .( (isset($url_components['hash']) && !in_array('hash', $_ntp)) ? '#'.$url_components['hash'] : '');

        return trim($n_url, '?&');
    }
public static function build ( array $ url_components = null , $ not_toput = null ) { if ( ! is_array ( $ url_components ) ) { return null ; } $ _ntp = $ not_toput ? ( is_array ( $ not_toput ) ? $ not_toput : array ( $ not_toput ) ) : array ( ) ; if ( isset ( $ _urls [ 'params' ] ) ) $ _urls [ 'params' ] = array_filter ( $ _urls [ 'params' ] ) ; $ n_url = ( ( isset ( $ url_components [ 'scheme' ] ) && ! in_array ( 'scheme' , $ _ntp ) ) ? $ url_components [ 'scheme' ] . '://' : 'http://' ) . ( ( isset ( $ url_components [ 'user' ] ) && ! in_array ( 'user' , $ _ntp ) ) ? $ url_components [ 'user' ] : '' ) . ( ( isset ( $ url_components [ 'pass' ] ) && ! in_array ( 'pass' , $ _ntp ) ) ? ':' . $ url_components [ 'pass' ] : '' ) . ( ( ( isset ( $ url_components [ 'user' ] ) && ! in_array ( 'user' , $ _ntp ) ) || ( isset ( $ url_components [ 'pass' ] ) && ! in_array ( 'pass' , $ _ntp ) ) ) ? '@' : '' ) . ( ( isset ( $ url_components [ 'host' ] ) && ! in_array ( 'host' , $ _ntp ) ) ? $ url_components [ 'host' ] : '' ) . ( ( isset ( $ url_components [ 'port' ] ) && ! in_array ( 'port' , $ _ntp ) ) ? ':' . $ url_components [ 'port' ] : '' ) . ( ( isset ( $ url_components [ 'path' ] ) && ! in_array ( 'path' , $ _ntp ) ) ? $ url_components [ 'path' ] : '' ) . ( ( isset ( $ url_components [ 'params' ] ) && ! in_array ( 'params' , $ _ntp ) ) ? '?' . http_build_query ( $ url_components [ 'params' ] ) : '' ) . ( ( isset ( $ url_components [ 'hash' ] ) && ! in_array ( 'hash' , $ _ntp ) ) ? '#' . $ url_components [ 'hash' ] : '' ) ; return trim ( $ n_url , '?&' ) ; }
Rebuild a full URL string from an array of elements

@param array $url_components The array of the URL components:: `scheme`, `user`,
`pass`, `host`, `port`, `path`, `params`, `hash`
@param string/array/boolean $not_toput The name of an array of elements to not include
@return string The final URL as a string
Rebuild a full URL string from an array of elements