Determine the business logic in the controller and use controller->set
to communicate the decisions to the views/elements.

Don't get too hung up on strict seperation of M->V->C there's plenty
of grey across the boundaries... A pragmatic approach if generally
more productive :)

Interesting discussion here:

http://groups.google.com/group/cake-php/browse_thread/thread/7786024149ca244b/efeb2a04e537e6b1?lnk=gst&q=stutchbury+view&rnum=1#efeb2a04e537e6b1

~GreyCells

On Feb 28, 7:44 pm, "phirschybar" <[EMAIL PROTECTED]> wrote:
> Hey all..
>
> What if I have an element and I want to switch it on for some pages
> and off for others?
>
> I could easily pass it some data and do the logic to determine if it
> should be shown right within the element itself or even in the default
> layout but then I would have business logic right in the views,
> violating MVC...
>
> How can I do the logic in the controller where it should be and only
> call the element from there?


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to