Welcome Guest, Not a member yet? Register   Sign In
Calling the database from a view file?
#4

[eluser]TheFuzzy0ne[/eluser]
Personally, I would move the logic out of the view, and have it in the controller. The controller is the place to process the data received from the models, and perhaps catch any potential problems and take the appropriate action. The controller can create an array of objects that can be passed in to the view. In my humble opinion, a view should simply format your output, and the data should be fed in as variables.

Of course, this only applies if you are trying to stick to the MVC pattern, which means that you should keep your presentation layer separate from your data layer. Otherwise, you're encouraged to use CodeIgniter in whatever way makes your life easiest.

I hope this helps.


Messages In This Thread
Calling the database from a view file? - by El Forum - 02-08-2009, 11:42 AM
Calling the database from a view file? - by El Forum - 02-08-2009, 12:04 PM
Calling the database from a view file? - by El Forum - 02-08-2009, 01:18 PM
Calling the database from a view file? - by El Forum - 02-08-2009, 01:54 PM
Calling the database from a view file? - by El Forum - 02-08-2009, 02:16 PM
Calling the database from a view file? - by El Forum - 02-08-2009, 02:49 PM
Calling the database from a view file? - by El Forum - 02-08-2009, 02:54 PM
Calling the database from a view file? - by El Forum - 02-10-2009, 12:36 AM
Calling the database from a view file? - by El Forum - 02-11-2009, 08:12 AM



Theme © iAndrew 2016 - Forum software by © MyBB