Good point. I'm all for following best-practices. However, what if,
for examples sake, I didn't need to include the navigation in every
page? I would be wasting time querying/compiling a list of categories
that wouldn't be accessed in the view.

This is assuming that by writing code in AppController it would be
called for every page regardless of whether or not it's needed.

Thanks for your time/patience.

On Oct 10, 3:24 am, Dave J <[EMAIL PROTECTED]> wrote:
> Why not simply get the categories in AppController, and set them to
> something like $siteNavigation, so that's it available to all pages
> (including elements).
>
> $this->set('siteNavigation', $this->Categories->find(...));
>
> It also removes the extra overhead of requestAction. Just remember to
> include the Categories model in AppController.
>
> On Oct 9, 2:10 pm, MikeB <[EMAIL PROTECTED]> wrote:
>
> > I need to be able to create a navigation used across my site on many
> > pages. This particular navigation is table-driven from the categories
> > table. It seems like using requestAction() of the categories
> > controller in an element, navigation.ctp, would be the perfect
> > solution.
>
> > I got all that to work fine, but it occurred to me that I would
> > probably need to make the navigation() action hidden, i.e.
> > _navigation(). However, when I try $this->requestAction('/categories/
> > navigation') it gives me a 'max nesting level' error. I tried changing
> > the param to '/categories/_navigation' but that had no change.
>
> > Here is the exact error:
> > Fatal error: Maximum function nesting level of '100' reached,
> > aborting!
>
> > Any thoughts? Am I going about this the wrong way?
--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to