public function getFullUrl() : string
    {
        $isSecure = $this->isSecure();
        $rawProtocol = strtolower($this->server->get('SERVER_PROTOCOL'));
        $parsedProtocol = substr($rawProtocol, 0, strpos($rawProtocol, '/')) . ($isSecure ? 's' : '');
        $port = $this->getPort();
        $host = $this->getHost();

        // Prepend a colon if the port is non-standard
        if ((!$isSecure && $port != '80') || ($isSecure && $port != '443')) {
            $port = ":$port";
        } else {
            $port = '';
        }

        return $parsedProtocol . '://' . $host . $port . $this->server->get('REQUEST_URI');
    }
public function getFullUrl() : string
    {
        $isSecure = $this->isSecure();
        $rawProtocol = strtolower($this->server->get('SERVER_PROTOCOL'));
        $parsedProtocol = substr($rawProtocol, 0, strpos($rawProtocol, '/')) . ($isSecure ? 's' : '');
        $port = $this->getPort();
        $host = $this->getHost();

        // Prepend a colon if the port is non-standard
        if ((!$isSecure && $port != '80') || ($isSecure && $port != '443')) {
            $port = ":$port";
        } else {
            $port = '';
        }

        return $parsedProtocol . '://' . $host . $port . $this->server->get('REQUEST_URI');
    }
public function getFullUrl ( ) : string { $ isSecure = $ this -> isSecure ( ) ; $ rawProtocol = strtolower ( $ this -> server -> get ( 'SERVER_PROTOCOL' ) ) ; $ parsedProtocol = substr ( $ rawProtocol , 0 , strpos ( $ rawProtocol , '/' ) ) . ( $ isSecure ? 's' : '' ) ; $ port = $ this -> getPort ( ) ; $ host = $ this -> getHost ( ) ; // Prepend a colon if the port is non-standard if ( ( ! $ isSecure && $ port != '80' ) || ( $ isSecure && $ port != '443' ) ) { $ port = ":$port" ; } else { $ port = '' ; } return $ parsedProtocol . '://' . $ host . $ port . $ this -> server -> get ( 'REQUEST_URI' ) ; }
Gets the full URL for the current request

@return string The full URL
@link http://stackoverflow.com/questions/6768793/get-the-full-url-in-php#answer-8891890
Gets the full URL for the current request