yii\web\Request::getHostName PHP Méthode

getHostName() public méthode

Value is calculated from current [[getHostInfo()|hostInfo]] property. > Warning: The content of this value may not be reliable, dependent on the server > configuration. Please refer to Request::getHostInfo for more information.
See also: getHostInfo()
Since: 2.0.10
public getHostName ( ) : string | null
Résultat string | null hostname part of the request URL (e.g. `www.yiiframework.com`)
    public function getHostName()
    {
        if ($this->_hostName === null) {
            $this->_hostName = parse_url($this->getHostInfo(), PHP_URL_HOST);
        }
        return $this->_hostName;
    }