cake-php@googlegroups.com
[Top] [All Lists]

Re: Why only pass $data to view instead of model instance?

Subject: Re: Why only pass $data to view instead of model instance?
From: cricket
Date: Tue, 16 Nov 2010 18:28:31 -0500
On Tue, Nov 16, 2010 at 5:22 PM, Miles J <mileswjohnson@xxxxxxxxx> wrote:
> @Cricket - How so? Just because the model has database access? It
> really doesn't matter if you pass the model to the view if you are
> using it for convenience methods. I think you are completely missing
> the point, this isn't about passing data to the view.

Not sure I understand what you mean, either. Not providing a model (by
default) to the view is a design decision based on "separation of
concerns" (google it). In a well-designed MVC framework, it not only
isn't necessary but would likely also be detrimental. And the point I
was trying to make is that having a model available for "convenience
methods" is no different from having it available for DB writes. ...
Which goes against the principles of the MVC pattern. IOW, this isn't
a "those Cake devs and their crazy notions" thing, but borne of a
decision to utilise the MVC pattern.

However, as Andy will remind us, "it's just PHP", and so it's a simple
matter to shoot oneself in the foot if one wants.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@xxxxxxxxxxxxxxxx
To unsubscribe from this group, send email to
cake-php+unsubscribe@xxxxxxxxxxxxxxxx For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

<Prev in Thread] Current Thread [Next in Thread>