Welcome Guest, Not a member yet? Register   Sign In
Joins: Controller or Model?
#1

[eluser]Denarius[/eluser]
I've literally been playing with Code Igniter for a couple of days and I'm on the brink of kicking off a project that uses a (moderately) complicated business model. I'm happy that I've created a suitable database model and have moved on to considering views and application logic, which is the hard part as far as I'm concerned!

For one of my views it will be necessary to query several tables and deliver the information about a particular event. In one particular case this is going to require an inner join across three tables in order to establish what performer is playing what instrument for a performance. Ultimately my question boils down to whether the join query belongs in the model or in the controller? My instincts are telling me controller since it's a manipulation of the data for presentation, but at this stage the model seems to be virtually redundant as Code Igniter seems to be inferring everything from the database structure. Also, the tutorials I've looked at seemed to ignore the model and go straight for $this->db->query in the controller itself, which leaves me wondering where the model classes belong in all this?

I'm grateful for any insight that anybody can offer on this.


Messages In This Thread
Joins: Controller or Model? - by El Forum - 03-02-2010, 08:50 AM
Joins: Controller or Model? - by El Forum - 03-02-2010, 08:54 AM
Joins: Controller or Model? - by El Forum - 03-02-2010, 10:08 AM
Joins: Controller or Model? - by El Forum - 03-02-2010, 03:12 PM
Joins: Controller or Model? - by El Forum - 03-03-2010, 12:45 PM
Joins: Controller or Model? - by El Forum - 03-03-2010, 01:03 PM
Joins: Controller or Model? - by El Forum - 03-03-2010, 05:28 PM
Joins: Controller or Model? - by El Forum - 03-04-2010, 11:01 AM
Joins: Controller or Model? - by El Forum - 03-04-2010, 11:13 AM
Joins: Controller or Model? - by El Forum - 03-04-2010, 05:21 PM



Theme © iAndrew 2016 - Forum software by © MyBB