Hi,

If you're new to PHP, the simplest way to repeat blocks of code on
different pages is to use the requestAction method, generally in your
controller, but available throughout.

This way you can have a controller just for your menus, with an action
and view like renderMenu, and then you can get this as a snippet for
your page by calling requestAction - your view can call it directly,
or you can call it in your controllers and pass it in to the views.

In the long term, you'll probably use an Element, as mindcharger
describes- your code is cleaner, and apparently it's faster, because
calls to requestAction go through the whole Cake dispatch process.

I hope that helps...

On Feb 14, 10:28 pm, "mindcharger" <[EMAIL PROTECTED]> wrote:
> Hey!
>
> I think you need an Element...
>
> Check this from CAKE manual:
>
> "Elements
>
> Many applications have small blocks of presentational code that needs
> to be repeated from page to page, sometimes in different places in the
> layout. Cake can help you repeat parts of your website that need to be
> reused. These reusable parts are called Elements. Ads, help boxes,
> navigational controls, extra menus, and callouts are often implemented
> in Cake as elements. An Element is basically a mini-view that can be
> included in other Views.
>
> Elements live in the /app/views/elements/ folder, and have the .thtml
> filename extension.
>
> The Element by default has no access to any data. To give it access to
> data, you send it in as a named parameter in an array."
>
> Is this what you looking for?
>
> Cheers


--~--~---------~--~----~------------~-------~--~----~
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