A Discussion on CSS implementation in Yii

I am new to frameworks in general and Yii specifically. In looking at the file structure, themeing, widgets, etc.; It seems to me that the Yii really goes against the write once, use everywhere tenants of programming when it comes to CSS and views.

In the basic WebApp generation I see ‘bg.gif’ in at least 4 different places. Shouldn’t it be in only one?

With Themes, that gets multiplied. I was looking into using themes for changing a site for various holidays. Now I have to copy my layout pages to ALL of the themes.

I hope you see what I’m getting at, I’m not sure that I am explaining it right. Can any of you Yii gurus help a lowly newbie understand some of the background/reasoning/voodoo/etc of the design?


I am not sure what you mean?

I only see bg.gif in one place: root/images.

Keep the common view/layout in protected/views.

Theme specific stuff goes in themes/your_theme/css|images|views.

If Yii can’t find it in your theme directory, it will try to find it in the ‘global’ directories.

All of the root/assets directories also get the bg.gif.

The themes don’t rollover the “main” info. I tried a theme from the web. all of my main menu items where lost and set to the theme/.../layouts/main.

The asset manager publishes assets in the assets directory. Don’t worry about it.

No there were not.

Is there a column1.php and column2.php in your theme directory?

Compare them to protected/views/layouts/column1|2.php.

Put your images in root document http_docs, under image directory.

In css write




layouts are rendered in main application php, you can`t setup image from protected folder because you have in .htaccess configured deny for all

NOTE: don`t change that