Welcome Guest, Not a member yet? Register   Sign In
What's your opinion on where models are executed: controllers or views?
#5

[eluser]frist44[/eluser]
[quote author="danbirlem" date="1269992179"][quote author="Ben Edmunds" date="1269991612"]...never make a call directly to a model from a controller.[/quote]

Why? It would seem natural to collect the data and pass through to a view from the controller. Using a model in the view seems redundant.[/quote]

This is how all of our applications work. I look at the controller as sort of the central brains of everything. Getting data from the model, and then passing to the model. If you start calling models from views, there's a hodgepodge of functions that are generally hard to track down and debug in a larger application. The folder layout is already spread out enough. When thinking about data, I like to know exactly where to look before I look and having that hard line of where data comes from helps with that.


Messages In This Thread
What's your opinion on where models are executed: controllers or views? - by El Forum - 03-30-2010, 12:39 PM



Theme © iAndrew 2016 - Forum software by © MyBB