Jon Bennett wrote:
> I would go about this slighty differently.
Great suggestion, Jon. Basically, the layout renders an element which
in turn requests an action. Here's my brief solution for my primary
navigation menu and my login/logout link:
Default Layout:
renderElement(primary_menu)
renderElement(login)
Primary Menu Element:
$doclist = $this->requestAction(/docs/getList)
foreach($doclist)
Login Element
if($this->requestAction(users/loggedIn) echo logout link
else echo login link
DocsController - getList
return $this->Doc->generateList()
UsersController - loggedIn
return $this->Session->check(User)
The problem I was having with all of this is that I don't understand
$this->requestAction well. I'm not sure what
$this->requestAction(model/method, array(return)) does? What's the
second parameter, array('return'), used for exactly? The API mentions
it but I don't understand it.
Again, Jon, thanks for you help.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~----------~----~----~----~------~----~------~--~---