Answer the question
In order to leave comments, you need to log in
How and where is @web alias defined in Yii2?
There is an old project on Yii2. In it, Yii::getAlias('@web') returns /project/web
Now I can't throw my new project on the server, since its Yii::getAlias('@web') is empty, and therefore the site cannot find css and js files. Where is the web root defined in the configuration?
The thing is that the project is located in the main domain folder domen/project/web
All links lead to domen , although they should lead to domen/project/web
B all js try to connect from js/main.js , although they should connect from project/ web/js/main.js
Answer the question
In order to leave comments, you need to log in
$config = [
'aliases' => [
'@foo' => '/path/to/foo',
'@bar' => 'http://www.example.com',
],
];
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question