CodeIgniter Forums
Controllers - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: Controllers (/thread-55948.html)



Controllers - El Forum - 11-18-2012

[eluser]ibnclaudius[/eluser]
I've always had problem organising my controllers. Generally I create only one controller, and inside it, all the methods, I know this is far from ideal.

At the moment, I'm developing a website for products review. So basically will have categories, products, users and reviews. How should I organise my controllers?

Basically, let's say I'd clone http://www.buzzillions.com/ How should I organize my controllers?

Thanks in advance.


Controllers - El Forum - 11-19-2012

[eluser]philm[/eluser]
[quote author="ibnclaudius" date="1353253781"]So basically will have categories, products, users and reviews...[/quote]
Grats, you have your answer... or at least a great start! Smile


Controllers - El Forum - 11-19-2012

[eluser]cartalot[/eluser]
the difficult one will probably be Users. write out all the different things Users can do -
List out the actions they can take, and the resources (database tables, etc) that they use.

Then group these actions into related tasks and start naming them. After you are clear on the requirements,
then look at using a CI auth library for the basic user creation and login tasks.



Controllers - El Forum - 11-19-2012

[eluser]InsiteFX[/eluser]
Code:
application/controllers/
- categories
- products
- reviews
- users