yii\web\UrlManager::getScriptUrl PHP Method

getScriptUrl() public method

It defaults to [[Request::scriptUrl]]. This is mainly used when [[enablePrettyUrl]] is false or [[showScriptName]] is true.
public getScriptUrl ( ) : string
return string the entry script URL that is used by [[createUrl()]] to prepend to created URLs.
    public function getScriptUrl()
    {
        if ($this->_scriptUrl === null) {
            $request = Yii::$app->getRequest();
            if ($request instanceof Request) {
                $this->_scriptUrl = $request->getScriptUrl();
            } else {
                throw new InvalidConfigException('Please configure UrlManager::scriptUrl correctly as you are running a console application.');
            }
        }
        return $this->_scriptUrl;
    }