Welcome Guest, Not a member yet? Register   Sign In
What format should rows of data be in when passed from a Model back to a Controller?
#1

[eluser]callumd[/eluser]
I have plenty of experience with PHP/MySQL but very limited experience with frameworks and CodeIgniter.

I'm just trying to make sure I get my "best practises" sorted out nice and early.

I have a question:

Is it bad practise to pass a database object back to a controller from a model?

Eg, if I hit a database inside a model to get some data, should I convert it in to an array and pass back the array?

Or should the controller convert the database object in to an array?

Or should it never happen, and the database object should be passed "as is" on to the view which then loops over it displaying each row?

What is the best practise here?

Thanks.


Messages In This Thread
What format should rows of data be in when passed from a Model back to a Controller? - by El Forum - 11-15-2010, 01:58 AM



Theme © iAndrew 2016 - Forum software by © MyBB