Most proper and fastest way to determine root directory for url creation

Hi,

I’m a newbie here, I’d like to know what is the most proper and fastest way to give full path of CSS file for CClientScript registerCssFile function, but also many other functions?

Thanks!

m

Hi,

This might solve your question:


Yii::app()->clientScript->registerCssFile(Yii::app()->baseUrl.'/css/form.css');

thanks, I thought there is maybe some alias or so …

anyway should I do it like this or use assets manager?

could anyone explain when to use which way?

thanks

I think this is no more working, the following code shows a blank page :


echo Yii::app()->getbaseUrl;exit;


echo Yii::app()->baseUrl;

or


echo Yii::app()->getBaseUrl();

or


echo Yii::app()->getBaseUrl(true);

(absolute URL)

/Tommy