public function getRootUrl($hasProtocol = true)
    {
        $url = $this->getServerName();
        $protocol = $hasProtocol ? $this->getProtocol() : '';
        if (!empty($protocol)) {
            $url = $protocol . $url;
        }
        if (!in_array((integer)$this->getServer('SERVER_PORT'), [80, 443], true)) {
            $url .= ':' . $this->getServer('SERVER_PORT');
        }
        return $url;
    }
public function getRootUrl($hasProtocol = true)
    {
        $url = $this->getServerName();
        $protocol = $hasProtocol ? $this->getProtocol() : '';
        if (!empty($protocol)) {
            $url = $protocol . $url;
        }
        if (!in_array((integer)$this->getServer('SERVER_PORT'), [80, 443], true)) {
            $url .= ':' . $this->getServer('SERVER_PORT');
        }
        return $url;
    }
public function getRootUrl ( $ hasProtocol = true ) { $ url = $ this -> getServerName ( ) ; $ protocol = $ hasProtocol ? $ this -> getProtocol ( ) : '' ; if ( ! empty ( $ protocol ) ) { $ url = $ protocol . $ url ; } if ( ! in_array ( ( integer ) $ this -> getServer ( 'SERVER_PORT' ) , [ 80 , 443 ] , true ) ) { $ url .= ':' . $ this -> getServer ( 'SERVER_PORT' ) ; } return $ url ; }
Devuelve la url completa de base
@param boolean $hasProtocol
@return string
Devuelve la url completa de base