Hi,
using Yii::app()->baseUrl and Yii::app()->theme->baseUrl always generates an absolute path relative to the base URi, like:
/js/setup.js
/themes/css/
and so on.
Is there a way to generate relative paths, without starting "/" like
js/setup.js ?
Example:
I use baseUrl in this way:
Yii::app()->baseUrl.’/js/setup.js’, which generates (depending on the project) something like:
/js/setup.js
or
/development/js/setup.js (where "development" is the basic folder from the development environment.)
But what I need is this:
js/setup.js
or
development/js/setup.js
so an
Yii::app()->clientScript->registerScriptFile(Yii::app()->baseUrl.'/js/setup.js', CClientScript::POS_END);
should generate something like:
<script type="text/javascript" src="js/suchfeld.js"></script>
OR (for development)
<script type="text/javascript" src="development/js/suchfeld.js"></script>
Is there an option to avoid the "/" at the beginning or something like that?
Thank you,
rall0r.