CodeIgniter Forums
controllers design - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: controllers design (/showthread.php?tid=4987)



controllers design - El Forum - 12-29-2007

[eluser]AtlantixMedia[/eluser]
Hi,

I have a login controller whose functions handle 3 different actions:

1) login
2) logout
3) lost password requests

is it better to have one distinct controller for each action or should I leave it as it is? what's goog practice?

thanks


controllers design - El Forum - 12-29-2007

[eluser]nmweb[/eluser]
Leave it as is, the methods belong together so should be in one controller. I'd abstract the actual login/logout stuff to a library though.


controllers design - El Forum - 12-29-2007

[eluser]AtlantixMedia[/eluser]
also,

I grouped several functions having the same "theme" in helper files(date_helper, email_helper, etc). is this proper design practice or should I group them inside classes?

thanks