Yii Framework Forum: What are components for? - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

What are components for? Rate Topic: -----

#1 User is offline   penkomitev 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 97
  • Joined: 12-February 09

Posted 19 February 2009 - 04:21 AM

Hi!

I am experiencing problems considering the write implementation of "Extracting cities from database" and filling data in dropDownlist. That's why I opened the blog tutorial demo and looked about Tags and Comments. Then, I saw the components folder, full of files. What is it exactly for?
0

#2 User is offline   krillzip 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 26
  • Joined: 14-January 09
  • Location:Sweden

Posted 19 February 2009 - 04:59 AM

The purpose for the components folder (in the protected directory) is to store classes (based on the CComponent class) that containes logic that might be shared between several controllers or other classes, where the logic can not cleanly be defined to be a view, model or controller.
0

#3 User is offline   qiang 

  • Yii Project Lead
  • Yii
  • Group: Yii Dev Team
  • Posts: 5,895
  • Joined: 04-October 08
  • Location:DC, USA

Posted 19 February 2009 - 06:28 AM

krillzip, thank you for explanation. For larger projects, you may want to create sub-directories of components to better categorize the components.
0

#4 User is offline   penkomitev 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 97
  • Joined: 12-February 09

Posted 19 February 2009 - 06:44 AM

Thank you very much guys!
0

#5 User is offline   sonam 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 79
  • Joined: 10-September 11

Posted 17 October 2011 - 01:15 PM

thanks guyssssssss
0

#6 User is offline   Sanu 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 5
  • Joined: 15-December 11
  • Location:Karawang, Indonesia

Posted 20 December 2011 - 03:15 AM

now i know, the purpose of components folder. thank u
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

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