Module Theming

Hi.

I’m writing a module which contains some themes, but I’m having troubles in displaying themes’ images.

Since the module is in the protected/ dir it’s unacessible due to .htaccess.

So the proper way to make those files available is


$cs=Yii::app()->clientScript;

$cs->registerCSSFile('/css/file.css');

and works. The problem now is that "file.css" contains references to images (as most themes), but these are still in protected and this not accessible by the browser!

How can I manage this?

Thanks!

hi don’t you save your themes under themes/admin or something similar will make your life easy

EDIT:

this might help you

http://www.yiiframework.com/doc/guide/1.1/en/topics.theming

http://www.yiiframework.com/doc/guide/1.1/en/basics.module

I want to keep the module self contained so I want to keep the files in modules/

Thanks for the links but provide generic info’s, not much about this specific issue

Maxxer since you dont wanna change you themes directory may this article will help you take a look

http://www.yiiframework.com/wiki/148/understanding-assets/

indeed this was the solution!

I moved all my js+css+img into assets, registered assets and then the scripts+css from there.

Thanks!

glad to help – yii is great