protected function getBaseUrl()
    {
        $port = '';
        if ($this->requestContext->getScheme() === 'https' && $this->requestContext->getHttpsPort() != 443) {
            $port = ":{$this->requestContext->getHttpsPort()}";
        }

        if ($this->requestContext->getScheme() === 'http' && $this->requestContext->getHttpPort() != 80) {
            $port = ":{$this->requestContext->getHttpPort()}";
        }

        $baseUrl = $this->requestContext->getBaseUrl();
        if (substr($this->requestContext->getBaseUrl(), -4) === '.php') {
            $baseUrl = pathinfo($this->requestContext->getBaseurl(), PATHINFO_DIRNAME);
        }
        $baseUrl = rtrim($baseUrl, '/\\');

        return sprintf(
            '%s://%s%s%s',
            $this->requestContext->getScheme(),
            $this->requestContext->getHost(),
            $port,
            $baseUrl
        );
    }
protected function getBaseUrl()
    {
        $port = '';
        if ($this->requestContext->getScheme() === 'https' && $this->requestContext->getHttpsPort() != 443) {
            $port = ":{$this->requestContext->getHttpsPort()}";
        }

        if ($this->requestContext->getScheme() === 'http' && $this->requestContext->getHttpPort() != 80) {
            $port = ":{$this->requestContext->getHttpPort()}";
        }

        $baseUrl = $this->requestContext->getBaseUrl();
        if (substr($this->requestContext->getBaseUrl(), -4) === '.php') {
            $baseUrl = pathinfo($this->requestContext->getBaseurl(), PATHINFO_DIRNAME);
        }
        $baseUrl = rtrim($baseUrl, '/\\');

        return sprintf(
            '%s://%s%s%s',
            $this->requestContext->getScheme(),
            $this->requestContext->getHost(),
            $port,
            $baseUrl
        );
    }
protected function getBaseUrl ( ) { $ port = '' ; if ( $ this -> requestContext -> getScheme ( ) === 'https' && $ this -> requestContext -> getHttpsPort ( ) != 443 ) { $ port = ":{$this->requestContext->getHttpsPort()}" ; } if ( $ this -> requestContext -> getScheme ( ) === 'http' && $ this -> requestContext -> getHttpPort ( ) != 80 ) { $ port = ":{$this->requestContext->getHttpPort()}" ; } $ baseUrl = $ this -> requestContext -> getBaseUrl ( ) ; if ( substr ( $ this -> requestContext -> getBaseUrl ( ) , - 4 ) === '.php' ) { $ baseUrl = pathinfo ( $ this -> requestContext -> getBaseurl ( ) , PATHINFO_DIRNAME ) ; } $ baseUrl = rtrim ( $ baseUrl , '/\\' ) ; return sprintf ( '%s://%s%s%s' , $ this -> requestContext -> getScheme ( ) , $ this -> requestContext -> getHost ( ) , $ port , $ baseUrl ) ; }
Returns base URL, with scheme, host and port, for current request context.
If no delivery URL is configured for current SiteAccess, will return base URL from current RequestContext.

@return string
Returns base URL with scheme host and port for current request context . If no delivery URL is configured for current SiteAccess will return base URL from current RequestContext .