Images path

How can I get ‘images’ folder path under both XAMPP (Windows) and on the deploy server (Linux)?


is possible solution, but it includes the ‘protected’ folder part. I can strip that, but I want a generic solution, which to work even if ‘images’ path has other location.

I use


Otherway you can use the alias webroot (webroot.images)

Take a look at this

Thank you very much!

I found


worked better for me


The default way is that for me for a long time

Yii::app()->baseUrl gives me localhost/myproject on localhost or online so Yii::app()->baseUrl.’/images’ gives the folder url for images both of two cases.