Yiic webapp and how it handles the "classic" theme

I’m confused on how the yiic webapp command auto-generates the “classic” theme. It seems that the best way to style an app is to do it all through the “themes” folder. When the yiic webapp command runs however, it places the layout views under /protected/views/layouts, the CSS under webapp/css, and images under webapp/images.

Shouldn’t those all be placed under the “classic” theme?

I’m also trying to understand the webapp/views folder in general when it comes to themes. Is it recommended that all of the view files within that folder stay exactly the same, and only when you need to make changes to them you copy/paste them into the themes folder?

The default setup doesn’t actually use any theme, hence the use of protected /views.

All it does is create a directory for a theme called ‘classic’, that’s all.

When you want to use a theme, place the css and images directories in themes/your_theme.

You don’t necessarily get rid of root/images|css and protected/views, because you can put resources shared between themes there.

Consult the theming section of the definitive guide to Yii.

Doesn’t it technically does use a theme with the default setup? The main.css and bg.gif files are something I would consider a theme, as well as layouts/column1.php, layouts/column2.php, and layouts/main.php.

Or am I thinking about this the wrong way. The ‘classic’ theme is just a placeholder for a default setup, and not a theme at all?

The ‘classic’ theme directory is merely an idea. Everything else is served from site_root/css|images and the default view location of protected/views. :)

IMO, it would be better if that directory had a css|images directory, because then it would be even more accessible.

So, you’re right:

The look is served as plain vanilla Yii.

Take a look at what the guide says:

topics.theming

So, if you don’t have a setting for theme in your app config, no theme is served.


'theme'=>'classic,