Yii Framework Forum: Folder structure ( once again ) - Yii Framework Forum

Jump to content

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

Folder structure ( once again )

#1 User is offline   Mathew Gor 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 14
  • Joined: 07-September 12

Posted 07 September 2012 - 10:01 AM

Hi guys.

I've checked out other folder structure threads but I couldn't find an answer to my question.
I'm having trouble deciding where to put my custom classes. I.e. I've made my custom URL manager which extends CUrlManager, also I've made my custom Database class which extends CDbConnection.

I'm just not sure where to put those.
I'm putting components in components folder ( so something that extends CComponent ( or whatever is called ) )
Lib is for 3rd party stuff
Extensions is again used for extensions...

Where do you keep stuff like that?

#2 User is offline   Boaz 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 371
  • Joined: 23-January 11

Posted 07 September 2012 - 01:46 PM

There is no clear cut answer to your question but rather multiple answers per the speaker's preferences and tendencies.
For example, you can have a look at this wiki article and examine their custom directories.

As for my tendency:Both of the classes you mention (CDbConnection & CUrlManager) are "application components" and I would very naturally put them under /components.
If my app would become heavy with custom components I would have considered creating custom directories where appropriate. For example, I have already created in the past in a real project /protected/components/validators subdirectory and would have also considered in your case to create something like /protected/components/webapp_components or the like.

Enjoy the thinking process! :)
Therapeutic PHP sessions My LinkedIn Profile

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