Yii Framework Forum: Component theme - Yii Framework Forum

Jump to content

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

Component theme Rate Topic: -----

#1 User is offline   Roosma 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 4
  • Joined: 12-April 10

Posted 29 April 2010 - 06:43 AM

Hello

Is it/will it be possible to define theme view files for components?

I read in the forum that for 1.0.x it is not possible because there were some concerns about performance if every widget would look for a theme file...
Does the theme feature in Yii support for components/views

The answer in that post was basically to use skins, but what if I don't have a widget but a portlet instead?

Cheers
0

#2 User is offline   jayrulez 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 348
  • Joined: 29-July 09

Posted 29 April 2010 - 07:40 AM

Isn't a portlet considered a widgets?
php:
foreach(array('cat', 'dog', 'cow') as $animal) echo $animal."\n";

python:
[(animal, print(animal)) for animal in ['cat', 'dog', 'cow']]

ruby:
['cat', 'dog', 'cow'].each {|animal| puts animal}


You say Tomato, I say Tomato.
0

#3 User is offline   Roosma 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 4
  • Joined: 12-April 10

Posted 29 April 2010 - 08:07 AM

True, CPortlet extends CWidget!
My bad...:)

Thanks
0

#4 User is offline   Roosma 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 4
  • Joined: 12-April 10

Posted 30 April 2010 - 01:55 AM

After having played around with the skins I came to the conclusion that in my case they aren't as useful as the theming option would be...

I have an installation of Yii that will have multiple sites implemented, and some of the components view files need to be totally different (layout and content) on the different sites, e.g. a shopping cart...

Since skins are themeable and therefore also use performance, that was said to be the concern, why not also just make the components themeable?

My quick fix for this will probably be to check in the component controller if a theme is being used and then render a different view file if needed. But it would be nice to have all the view files associated with a theme in the themes folder.

So if anyone has a nice solution for this please reply...

Thanks, :)
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