Thanks John -

But I see a few issues with that approach.
Let me give an example - google analytics occasionally needs to be
overridden on specific pages (i.e to register a custom page view,
rather than the one in the address bar).

It doesn't seem right to me that every single view needs to include
the google analytics snippet - passing custom info to the view as and
when we need seems a lot nicer than refactoring every single view in
the system, and ensuring that new developers to the project know of
all these mystical, business critical elements they have to place in
every new view they create....



On Apr 7, 1:35 pm, John Andersen <j.andersen...@gmail.com> wrote:
> I suggest taking the common part of the layout out from the layout and
> create it as an element, then invoke it from the view, passing the
> data to the element.
> Enjoy,
>    John
>
> On Apr 7, 3:03 pm, the_woodsman <elwood.ca...@gmail.com> wrote:
>
> > Hi fellow bakers,
>
> > I often need to pass presentation related data from the view to the
> > layout - for example, when the layout has somethign for every singel
> > page, that individual pages can customise / override.
>
> > So far, the best solution I've found is to set things in the view via
> > the viewVars array, which is accesible in the layout.
>
> > Does Cake provide a way to do this more elgantly? Is there a
> > View::passToLayout function?
> > If not, what would be the best practice for implementing such a thing?
>
> > Thanks in advance!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to