Yii Framework Forum: widget VS old methods? - Yii Framework Forum

Jump to content

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

widget VS old methods? Rate Topic: -----

#1 User is offline   webscriptz.be 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 58
  • Joined: 24-August 09
  • Location:OLW WAVER, Belgium

Posted 22 July 2010 - 04:11 PM

Hello everyone,

This is probably a question already asked numerous times but i can't seem to find an answer in the topics:

I'm creating a small site with a news, contact, some regular info etc but I have a dilemma; why and when using and creating a widget and when doing it old school with a for each loop.

If i do it old school i save tons of time and lines of code and i only need to use it at one place and the template isn't a problem either. Besides this widgets seem to only be usefull when you use dateproviders while I tend to take a shorter route with AR.

Can someone give a bit a advice on when to use widgets best?

Thanks
0

#2 User is offline   mech7 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 220
  • Joined: 26-March 09

Posted 22 July 2010 - 09:36 PM

I would use a widget anytime I would need the same display on more then one page. Also you dont need any dataprovider you can add any data to a widget. Just overwrite the public vars.
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