Welcome Guest, Not a member yet? Register   Sign In
MVC structural advice - separation of code
#12

[eluser]coffeeandcode[/eluser]
One more thing, the basic rule of thumb I use for MVC is:

- any and all data access goes into a model (whether it's from a DB, XML file, RSS feed, or even just a PHP array)
- any and all html output goes into a view (html can be passed around in variables, but it is not sent to the browser until it gets to a view)
- everything else goes into a controller

The obvious exceptions to the last rule are things that aren't directly related to a data source - things that would normally go into a helper or library. But if it has data, the above 3 rules apply.


Messages In This Thread
MVC structural advice - separation of code - by El Forum - 06-15-2010, 02:31 PM
MVC structural advice - separation of code - by El Forum - 06-15-2010, 06:07 PM
MVC structural advice - separation of code - by El Forum - 06-16-2010, 07:32 AM
MVC structural advice - separation of code - by El Forum - 06-16-2010, 07:37 AM
MVC structural advice - separation of code - by El Forum - 06-16-2010, 09:11 AM
MVC structural advice - separation of code - by El Forum - 06-16-2010, 03:00 PM
MVC structural advice - separation of code - by El Forum - 06-16-2010, 03:07 PM
MVC structural advice - separation of code - by El Forum - 07-22-2010, 06:09 AM
MVC structural advice - separation of code - by El Forum - 07-22-2010, 06:24 AM
MVC structural advice - separation of code - by El Forum - 07-22-2010, 09:29 AM
MVC structural advice - separation of code - by El Forum - 07-22-2010, 11:05 AM
MVC structural advice - separation of code - by El Forum - 07-22-2010, 11:09 AM
MVC structural advice - separation of code - by El Forum - 07-22-2010, 11:16 AM
MVC structural advice - separation of code - by El Forum - 07-22-2010, 11:25 AM
MVC structural advice - separation of code - by El Forum - 07-22-2010, 11:51 AM
MVC structural advice - separation of code - by El Forum - 07-22-2010, 12:25 PM
MVC structural advice - separation of code - by El Forum - 07-22-2010, 12:55 PM
MVC structural advice - separation of code - by El Forum - 07-22-2010, 01:03 PM
MVC structural advice - separation of code - by El Forum - 07-22-2010, 01:29 PM
MVC structural advice - separation of code - by El Forum - 07-22-2010, 01:50 PM
MVC structural advice - separation of code - by El Forum - 07-22-2010, 02:29 PM
MVC structural advice - separation of code - by El Forum - 07-01-2012, 09:30 AM



Theme © iAndrew 2016 - Forum software by © MyBB