public function get($path = '', $options = array(), $absolute = false, $nolangcode = false)
    {
        $pass_absolute = false;

        if (!empty($path)) {
            if ($absolute && $this->isAbsolute($path)) {
                $url = $path;
                $pass_absolute = true;
            } else {
                $url = $this->request->base($nolangcode) . trim($path, '/');
            }
        } else {
            $url = $this->server->requestUri();
        }

        $url = strtok($url, '?');

        if ($absolute && !$pass_absolute) {
            $url = $this->server->httpScheme() . $this->server->httpHost() . $url;
        }

        $url = empty($options) ? $url : "$url?" . http_build_query($options);

        return filter_var($url, FILTER_SANITIZE_URL);
    }
public function get($path = '', $options = array(), $absolute = false, $nolangcode = false)
    {
        $pass_absolute = false;

        if (!empty($path)) {
            if ($absolute && $this->isAbsolute($path)) {
                $url = $path;
                $pass_absolute = true;
            } else {
                $url = $this->request->base($nolangcode) . trim($path, '/');
            }
        } else {
            $url = $this->server->requestUri();
        }

        $url = strtok($url, '?');

        if ($absolute && !$pass_absolute) {
            $url = $this->server->httpScheme() . $this->server->httpHost() . $url;
        }

        $url = empty($options) ? $url : "$url?" . http_build_query($options);

        return filter_var($url, FILTER_SANITIZE_URL);
    }
public function get ( $ path = '' , $ options = array ( ) , $ absolute = false , $ nolangcode = false ) { $ pass_absolute = false ; if ( ! empty ( $ path ) ) { if ( $ absolute && $ this -> isAbsolute ( $ path ) ) { $ url = $ path ; $ pass_absolute = true ; } else { $ url = $ this -> request -> base ( $ nolangcode ) . trim ( $ path , '/' ) ; } } else { $ url = $ this -> server -> requestUri ( ) ; } $ url = strtok ( $ url , '?' ) ; if ( $ absolute && ! $ pass_absolute ) { $ url = $ this -> server -> httpScheme ( ) . $ this -> server -> httpHost ( ) . $ url ; } $ url = empty ( $ options ) ? $ url : "$url?" . http_build_query ( $ options ) ; return filter_var ( $ url , FILTER_SANITIZE_URL ) ; }
Returns an internal or external URL
@param string $path
@param array $options
@param boolean $absolute
@param boolean $nolangcode
@return string|false
Returns an internal or external URL