Installation in a subdirecktory

Hallo,

I want to install yii in some subdirecktory e.g. www.my-domain.com/yii-framework/

I have uploaded files in to direcktory yii-framework

www.my-domain.com/yii-framework/demos/blog/ is working.

I create with a console "new site".

.../yii-framework/framework> php yiic webapp ../

I change in the the file .../yii-framework/index.php

the line “$yii=dirname(FILE).’/../yii.php’;” with

the line “$yii=dirname(FILE).’/framework/yii.php’;”

The original "new site" is working.

The line "<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/form.css" />" shows at "www.my-domain.com/yii-framework/css/form.css" it is o.k.

But the line “<?php Yii::app()->clientScript->registerCssFile(’/css/form.css’); ?>” shows at “www.my-domain.com/css/form.css” it is NOT o.k.

Is there some variable to set my subdirecktory?

If the first line work, than just use the baseUrl in the second line like:




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



Also check out the bu() shortcut helper, mentioned in this cookbook, which can be used like:


<img src="<?php echo bu('img/icon.gif'); ?>" />

Thanks all!


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

It’s working fine.

It was nice to have BU-prefix in registerCssFile and co. methods.