CodeIgniter Forums
Should I use HMVC or create my own library to work in this instance - 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: Should I use HMVC or create my own library to work in this instance (/showthread.php?tid=11876)



Should I use HMVC or create my own library to work in this instance - El Forum - 09-26-2008

[eluser]dcunited08[/eluser]
Currently, I have a site that allows you to view data in either by shift, over time, or in a set time period on a dashboard view. So you have three pages Shift.php, Time.php and Dashboard.php that are called via ajax calls to serve up data (either a table or an image-chart). The data is currently being handled by scripts that react different ways by which page calls them and what parameters are given to them. Say you have a chart displaying Thingys per hour (tph). If it is called by the Shift.php and given a shift number, it shows tph for that shift; if it is given dates, it shows the tph for that list of dates and, finally, the dashboard will give set parameters to set the timeperiod and ask for it in a different size format. Now this sounds like something that HMVC will be able to handle:

Code:
Shift_controller -> TPH_controller -> TPH_model -> TPH_controller -> TPH_view ->
TPH_controller -> Shift_controller

My question is this how it can work, the TPH_controller determine everything and return it back to the Shift_controller (or the Dates_controller) to send back to the user. Is this also the best workflow for something like this? Keep in mind I have around 50 scripts to be handled in this way.