Theming Zii Widget: themeUrl

I changed the JQuery UI theme on my zii widgets using the following instructions: http://www.yiiframework.com/wiki/107/theming-your-zii-widgets/

I found that I had to reference the themeURL using the project name (see below). My question is, why is it that I have to include the project name in the themeURL, while in the original instructions there was no need to include it?




        'widgetFactory' => array(

            'widgets' => array(

                'CJuiDatePicker' => array(

                    'themeUrl' => '/project_name/css/ui',

                    'theme' => 'blue',

                    'cssFile' => 'jquery-ui-1.8.20.custom.css',

                ),

                'CJuiTabs' => array(

                    'themeUrl' => '/project_name/css/ui',

                    'theme' => 'blue',

                    'cssFile' => 'jquery-ui-1.8.20.custom.css',

                ),

            ),

        ),

And what’s about


themeUrl' => Yii::app()->baseUrl .'/css/ui'

?

That’s a good idea in case the base URL changes.

Actually, that’s not working. I don’t think the basePath has been initialized yet because


Yii::app()->request->baseUrl

is NULL.

I had to use the following code in the main.php config file to get the baseURL. Is there another way to get the base URL, or is this the best way?




$request =  new CHttpRequest();

$baseURL = $request->getBaseUrl(false);