HOw to write a question here in this forum

How to use path alias in yii2 correctly?

Hi, can you please help me with path alias?

See in attached txt my code… when echoing the first echo statement in view, it gives the correct folder where I want to upload my file…

but in the controller I have to write an other path:

$model->file->saveAs([b]$path1.'/uploads' [/b]. $model->file->baseName . '.' . $model->file->extension);

instead of

$model->file->saveAs([b]$path1[/b] . $model->file->baseName . '.' . $model->file->extension);

Can you please point me to the right way of doing this?

Many thanks