Prado\Web\TUrlMappingPattern::applySecureConnectionPrefix PHP Метод

applySecureConnectionPrefix() защищенный Метод

Apply behavior of {@link SecureConnection} property by conditionaly prefixing URL with {@link THttpRequest::getBaseUrl()}
С версии: 3.2
protected applySecureConnectionPrefix ( string $url ) : string
$url string
Результат string
    protected function applySecureConnectionPrefix($url)
    {
        static $request;
        if ($request === null) {
            $request = Prado::getApplication()->getRequest();
        }
        static $isSecureConnection;
        if ($isSecureConnection === null) {
            $isSecureConnection = $request->getIsSecureConnection();
        }
        switch ($this->getSecureConnection()) {
            case TUrlMappingPatternSecureConnection::EnableIfNotSecure:
                if ($isSecureConnection) {
                    return $url;
                }
                return $request->getBaseUrl(true) . $url;
                break;
            case TUrlMappingPatternSecureConnection::DisableIfSecure:
                if (!$isSecureConnection) {
                    return $url;
                }
                return $request->getBaseUrl(false) . $url;
                break;
            case TUrlMappingPatternSecureConnection::Enable:
                return $request->getBaseUrl(true) . $url;
                break;
            case TUrlMappingPatternSecureConnection::Disable:
                return $request->getBaseUrl(false) . $url;
                break;
            case TUrlMappingPatternSecureConnection::Automatic:
            default:
                return $url;
                break;
        }
    }