Welcome Guest, Not a member yet? Register   Sign In
Using model functions in View
#7

[eluser]BrianDHall[/eluser]
Technically, MVC principles state that if you want to display certain content you should pull the data you want using a Model into your Controller, use the Controller to load the data you want displayed, then pass the data to the View for displaying.

The idea is that the View should be agnostic, or in fact totally ignorant, of where its information/content comes from. All it knows is it should be passed certain variables, and it should display them nicely.

The upside is if at some point you want to load or access the information in a different way you should not need to edit the view. The goal is to eliminate spaghetti code - meaning, code where if you have to change anything you have to go through all sorts of different files to make minor adjustments.


Messages In This Thread
Using model functions in View - by El Forum - 09-20-2009, 07:12 AM
Using model functions in View - by El Forum - 09-20-2009, 07:19 AM
Using model functions in View - by El Forum - 09-20-2009, 08:14 AM
Using model functions in View - by El Forum - 09-20-2009, 08:29 AM
Using model functions in View - by El Forum - 09-20-2009, 09:22 AM
Using model functions in View - by El Forum - 09-20-2009, 11:59 AM
Using model functions in View - by El Forum - 09-20-2009, 02:36 PM
Using model functions in View - by El Forum - 09-20-2009, 03:42 PM
Using model functions in View - by El Forum - 09-20-2009, 05:58 PM
Using model functions in View - by El Forum - 09-20-2009, 06:41 PM
Using model functions in View - by El Forum - 09-20-2009, 07:52 PM
Using model functions in View - by El Forum - 09-21-2009, 01:31 AM
Using model functions in View - by El Forum - 09-21-2009, 06:45 AM



Theme © iAndrew 2016 - Forum software by © MyBB