How to check for login from template
- Bill Lions
- Member | 47
I have a menu link for login.
When the user is logged in, I wish to change this to the logout link.
Is this best done from the template, or set a status in the presenter and check the value of the status in the template?
- David Matějka
- Moderator | 6445
you can use $user variable, which is available in every template:
{if $user->isLoggedIn()}
logout link
{else}
login link
{/if}