Welcome Guest, Not a member yet? Register   Sign In
How to split the controller / model workload
#8

[eluser]Dave Stewart[/eluser]
Hey xwero,

Thanks so much for the information, and for taking the time to actually write some PHP code. You've really helped to clarify for me where the logic should be going.

I was having similar thoughts myself with regards to views and entering the JS using $this->load->view().

With regards to the sorting, this is my latest reckoning:

1 - Model: build the query and calculate the sort / datatypes
2 - Controller: build the table, and grab the datatype information from the Model, embedding it in the table head th tags: <th datatype="date">
3 - View: have the JavaScript table sorting function be inserted using the Controller->load->view method

The advantage of including the datatype in the table heading is that my Javascript can just look in one place to formulate the sorting algorithms.

Thanks again for your help,
Cheers,
Dave


Messages In This Thread
How to split the controller / model workload - by El Forum - 06-24-2008, 03:23 AM
How to split the controller / model workload - by El Forum - 06-24-2008, 03:38 AM
How to split the controller / model workload - by El Forum - 06-24-2008, 03:56 AM
How to split the controller / model workload - by El Forum - 06-24-2008, 04:03 AM
How to split the controller / model workload - by El Forum - 06-24-2008, 04:17 AM
How to split the controller / model workload - by El Forum - 06-24-2008, 04:39 AM
How to split the controller / model workload - by El Forum - 06-24-2008, 04:56 AM
How to split the controller / model workload - by El Forum - 06-24-2008, 05:27 AM
How to split the controller / model workload - by El Forum - 06-24-2008, 05:41 AM



Theme © iAndrew 2016 - Forum software by © MyBB