public function baseURL($path = '')
    {
        if (is_null($this->baseURL)) {
            $self = $_SERVER['PHP_SELF'];
            $server = $_SERVER['HTTP_HOST']
                      . rtrim(str_replace(strstr($self, 'index.php'), '', $self), '/');

            if ((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off')
                || !empty($_SERVER['HTTP_X_FORWARDED_PROTO'])
                && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https'
            ) {
                $protocol = 'https://';
            } else {
                $protocol = 'http://';
            }

            $this->baseURL = $protocol . $server;
        }

        $url = $this->baseURL;

        if ($path !== '') {
            $url .= '/' . $path;
        }

        return $url;
    }
public function baseURL($path = '')
    {
        if (is_null($this->baseURL)) {
            $self = $_SERVER['PHP_SELF'];
            $server = $_SERVER['HTTP_HOST']
                      . rtrim(str_replace(strstr($self, 'index.php'), '', $self), '/');

            if ((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off')
                || !empty($_SERVER['HTTP_X_FORWARDED_PROTO'])
                && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https'
            ) {
                $protocol = 'https://';
            } else {
                $protocol = 'http://';
            }

            $this->baseURL = $protocol . $server;
        }

        $url = $this->baseURL;

        if ($path !== '') {
            $url .= '/' . $path;
        }

        return $url;
    }
public function baseURL ( $ path = '' ) { if ( is_null ( $ this -> baseURL ) ) { $ self = $ _SERVER [ 'PHP_SELF' ] ; $ server = $ _SERVER [ 'HTTP_HOST' ] . rtrim ( str_replace ( strstr ( $ self , 'index.php' ) , '' , $ self ) , '/' ) ; if ( ( ! empty ( $ _SERVER [ 'HTTPS' ] ) && $ _SERVER [ 'HTTPS' ] != 'off' ) || ! empty ( $ _SERVER [ 'HTTP_X_FORWARDED_PROTO' ] ) && $ _SERVER [ 'HTTP_X_FORWARDED_PROTO' ] === 'https' ) { $ protocol = 'https://' ; } else { $ protocol = 'http://' ; } $ this -> baseURL = $ protocol . $ server ; } $ url = $ this -> baseURL ; if ( $ path !== '' ) { $ url .= '/' . $ path ; } return $ url ; }
Return the baseURL

@access public
@return string http://tld.com
Return the baseURL