So, what I want to do, in my main layout there is a menu for user login and another for anonymous users.
The layout will be used on every page, so I'm not sure how to do it, as I saw, the Auth component can only be used in the controller, it would be nice if I had to do this in only one view, but for each view, how I can do it? Do I have to do something on the AppController?
What I want to do is basically
// layout <?php if(logged): ?> Welcome <?php echo $user; ?> <?php else: ?> Welcom anon, Log in? <?php endif; ?>
source share