![]() |
Grouping related categories into a single controller or split apart? - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: Grouping related categories into a single controller or split apart? (/showthread.php?tid=55218) |
Grouping related categories into a single controller or split apart? - El Forum - 10-15-2012 [eluser]gwerner[/eluser] Is there a best or common practice with regards to the number of methods in a controller? I'm working on a backend admin and some of my controllers are becoming rather large in size. By large I mean long. And they become more difficult to traverse the longer they get. I'm currently building a section that is used to log changes to the main site. Currently the single controller structure is like: Changes index add modify save remove approvals addapproval modifyapproval saveapproval removeapproval The controller Changes contains a couple of sub-categories, "changes and approvals". The approvals portion is a database of individuals who are responsible for approving the changes made to the site. Fairly simple. However, the controller is getting quite long and what if I add a another group of people, those who are actually editing the site. These sub categories are related to the top category Changes. Should I separate the two into their own controllers even though they are connected to some degree? Or, leave as is? Maybe it doesn't matter and it's user preference. I'd just like to get a quick opinion before I create a mess. Thanks to any who can offer guidance. |