You are right, you cannot use the Yii :: app () methods inside the array of returned configurations, but you can use Yii::getPathOfAlias() outside. Maybe something like this:
$webroot = Yii::getPathOfAlias('webroot'); return array( ... 'params'=>array( 'paths' => array( 'imageTemp'=> $webroot.'/files/temp-', 'image'=> $webroot.'/files/', ... ), ), );
Assuming webroot is predefined.
As for baseUrl ... I will get back to you on this!
[Back ...]
If you need a URL, it all depends on where your image files are stored, relative to the yii path or relative to the base of the web root?
If the base is the root website, you can simply use:
return array( ... 'urls'=>array( 'paths' => array( 'imageTemp'=> '/files/temp-', 'image'=> '/files/', ... ), ), );
source share