Or maybe something like $this->set('is_logged',$this->Session->check(' user.id'))
Or maybe some logic in the view wont hurt anybody
On 5/10/06, Vortexmind <[EMAIL PROTECTED]
> wrote:
Hi
I have another question, but I think it's rather a MVC understanding
problem than really a cakephp one... but I'm not sure.
Problem: I am doing my website's template, and I have some common
elements. For example, I have a three-column layout, and in the left
column I have a little user box and a Menu. I wanted to make this
dynamic: for example, if user is not logged in (i.e. a session is not
set) I want to display the login form, if he is logged in I wanted to
display "Welcome back ABC bla bla" ... and maybe change the menu
contents.
So, I know how to do this ... but I'm not sure what's the "best
pratice" to get this:
Should I put logic in my element 's .thtml, or make different elements
to choose depending on the situation (then putting logic in the
template ... and this sounds awful as the one above), or is there a
nice way to put the logic in the controller and instruct the view in a
neat way (as it should be) ?
Thank you for your attention
www.dospuntocero.info
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---
