Welcome Guest, Not a member yet? Register   Sign In
Question about M-V-C
#3

[eluser]obiron2[/eluser]
Broadly speaking:
if you need to show it to the user, then it goes in the view
If you need to get it from or send it to a database (or disk system, flat file, log record etc) then it goes in a model
Everything else goes in the controller.

Note that there are exceptions but if you start with the above, you will not go too far wrong.

It would have been better if the process had been called MCV. The Controller gets information from the Model and passes it to the View or gets information from the View (posted form) and passes it to the Model.


The most important thing to remember is that the controller should never output anything directly to the screen, nor should it read or write directly to a file.



Messages In This Thread
Question about M-V-C - by El Forum - 06-28-2012, 02:13 PM
Question about M-V-C - by El Forum - 06-28-2012, 06:15 PM
Question about M-V-C - by El Forum - 06-29-2012, 03:22 AM



Theme © iAndrew 2016 - Forum software by © MyBB