thyseus
(Thyseus)
June 29, 2009, 2:00pm
1
Hello.
I have conquered the need to do something like this:
File: <app>/protected/config/main.php:
'appUrl' => 'http://localhost/myapp/',
This is the absolute path, where my Application resides.
After that, i can use it to set a path relative from this one:
$image = Yii:app()->config['appUrl'] . "/images/myimage.png";
At the moment it raises an Exception in framework/base/CModule.php(404)
because there is no private Variable appUrl, but i fixed this for my purpose.
Does it make sense to apply this "feature" in future Yii Versions?
Ismael
(Shalanga)
June 29, 2009, 2:57pm
2
What you are saying isn't this?
Yii::app()->request->baseUrl
thyseus
(Thyseus)
June 30, 2009, 11:45am
3
baseUrl seems to be the name of the folder, where my application is placed.
I wanted to deploy the whole URL of the Web-Server where my Project is placed, so i can move it whereever i want and just need to modify one line, instead of hundred places scattered around my source code.
so, for example: http://www.yiiframework.com/myapp
baseUrl would be: myapp
appUrl would be: http://www.yiiframework.com/myapp/