maxxer
(Maxxer)
October 26, 2012, 6:31am
1
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!
alirz23
(Ali Raza)
October 26, 2012, 8:00am
2
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
maxxer
(Maxxer)
October 26, 2012, 9:34am
3
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
alirz23
(Ali Raza)
October 26, 2012, 9:48am
4
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/
maxxer
(Maxxer)
October 26, 2012, 12:40pm
5
indeed this was the solution!
I moved all my js+css+img into assets, registered assets and then the scripts+css from there.
Thanks!
alirz23
(Ali Raza)
October 26, 2012, 12:43pm
6
glad to help – yii is great