Alias and filepaths


in the documentation here:

It states that

However when I run both of these and echo them out:

echo Yii::getAlias('@webroot') //  output = C:\inetpub\wwwroot\yii\YiiAdvanced\frontend\web

echo Yii::$app->request->baseUrl; // output = /yii/YiiAdvancedMess/frontend/web


So they are not giving the same result, one gives a file path the other gives the web url path.

Is there something I should do to get the URL or file path when I need them on an alias?


Spot the deliberate mistake!

I was using @webroot not @web