yii\web\UrlManager::getHostInfo PHP Method

getHostInfo() public method

Returns the host info that is used by UrlManager::createAbsoluteUrl to prepend to created URLs.
public getHostInfo ( ) : string
return string the host info (e.g. "http://www.example.com") that is used by [[createAbsoluteUrl()]] to prepend to created URLs.
    public function getHostInfo()
    {
        if ($this->_hostInfo === null) {
            $request = Yii::$app->getRequest();
            if ($request instanceof \yii\web\Request) {
                $this->_hostInfo = $request->getHostInfo();
            } else {
                throw new InvalidConfigException('Please configure UrlManager::hostInfo correctly as you are running a console application.');
            }
        }
        return $this->_hostInfo;
    }