public function getBaseUrl($scheme_only = false)
    {
        if (null === $this->baseUrlScheme) {
            $scheme = "http";
            $port = 80;

            if ($host = $this->requestContext->getHost()) {
                $scheme = $this->requestContext->getScheme();

                $port = '';

                if ('http' === $scheme && 80 != $this->requestContext->getHttpPort()) {
                    $port = ':'.$this->requestContext->getHttpPort();
                } elseif ('https' === $scheme && 443 != $this->requestContext->getHttpsPort()) {
                    $port = ':'.$this->requestContext->getHttpsPort();
                }
            }

            $this->baseUrlScheme = "$scheme://$host"."$port";
        }

        return $scheme_only ? $this->baseUrlScheme : $this->baseUrlScheme . $this->requestContext->getBaseUrl();
    }
public function getBaseUrl($scheme_only = false)
    {
        if (null === $this->baseUrlScheme) {
            $scheme = "http";
            $port = 80;

            if ($host = $this->requestContext->getHost()) {
                $scheme = $this->requestContext->getScheme();

                $port = '';

                if ('http' === $scheme && 80 != $this->requestContext->getHttpPort()) {
                    $port = ':'.$this->requestContext->getHttpPort();
                } elseif ('https' === $scheme && 443 != $this->requestContext->getHttpsPort()) {
                    $port = ':'.$this->requestContext->getHttpsPort();
                }
            }

            $this->baseUrlScheme = "$scheme://$host"."$port";
        }

        return $scheme_only ? $this->baseUrlScheme : $this->baseUrlScheme . $this->requestContext->getBaseUrl();
    }
public function getBaseUrl ( $ scheme_only = false ) { if ( null === $ this -> baseUrlScheme ) { $ scheme = "http" ; $ port = 80 ; if ( $ host = $ this -> requestContext -> getHost ( ) ) { $ scheme = $ this -> requestContext -> getScheme ( ) ; $ port = '' ; if ( 'http' === $ scheme && 80 != $ this -> requestContext -> getHttpPort ( ) ) { $ port = ':' . $ this -> requestContext -> getHttpPort ( ) ; } elseif ( 'https' === $ scheme && 443 != $ this -> requestContext -> getHttpsPort ( ) ) { $ port = ':' . $ this -> requestContext -> getHttpsPort ( ) ; } } $ this -> baseUrlScheme = "$scheme://$host" . "$port" ; } return $ scheme_only ? $ this -> baseUrlScheme : $ this -> baseUrlScheme . $ this -> requestContext -> getBaseUrl ( ) ; }
Return the base URL, either the base_url defined in Config, or the URL
of the current language, if 'one_domain_foreach_lang' is enabled.

@param bool $scheme_only if true, only the scheme will be returned. If false, the complete base URL, including path, is returned.

@return string the base URL, with a trailing '/'
Return the base URL either the base_url defined in Config or the URL of the current language if one_domain_foreach_lang is enabled .