Images path

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


Yii::app()->basePath

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


 Yii::app()->basePath.'../images' 

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

Take a look at this

Thank you very much!

I found


Yii::app()->baseUrl.'/images' 

worked better for me

Regards

The default way is that for me for a long time

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