Yii Framework Forum: Yiic webapp and how it handles the "classic" theme - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Yiic webapp and how it handles the "classic" theme Rate Topic: -----

#1 User is offline   chuntley 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 69
  • Joined: 23-April 10

Posted 22 December 2010 - 11:50 AM

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?
0

#2 User is offline   jacmoe 

  • Elite Member
  • Yii
  • Group: Moderators
  • Posts: 3,710
  • Joined: 10-October 10
  • Location:Denmark

Posted 22 December 2010 - 12:07 PM

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.
"Less noise - more signal"
0

#3 User is offline   chuntley 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 69
  • Joined: 23-April 10

Posted 22 December 2010 - 12:17 PM

View Postjacmoe, on 22 December 2010 - 12:07 PM, said:

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.


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?
0

#4 User is offline   jacmoe 

  • Elite Member
  • Yii
  • Group: Moderators
  • Posts: 3,710
  • Joined: 10-October 10
  • Location:Denmark

Posted 22 December 2010 - 12:54 PM

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,


"Less noise - more signal"
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users