Sorry if the question is silly for you but seems like I can't figured t out. I have two functions isLogged and isAdmin. They work perfectly and based on them I want to create links on my navbar. What I'm trying is this
<li>Non Logged users link visible for everyone visiting the site</li>
@if(isLoggedIn() && !isAdmin())
<li>LoggedIn Link</li>
@if(isLoggedIn() || isAdmin())
<li><a href="">Both</a></li>
@endif
<li><a href="#">Logged In link</a></li>
@elseif(isAdmin())
<li><a href="#">Admin Dashboard</a></li>
@else
<li><a href="#">Login</a></li>
@endif
Basically what I want to create here is
- All logged in
userswhich aren'tadminsto have some links which aren't visible for admins. - All logged in
userswhich areadminsto have different links which are visible only for them. - All logged in
usersno matteradminsor normal users to have addition links to their links.
@if -> (BaseController::isLoggedIn() && !BaseController::isAdmin()) checks if user is logged but not admin
then inside I've placed another if which should show <li><a href="">Both</a></li> on Admins and users since they are logged in... But I see this link only on logged in User. On Admin isn't visible.
I'm aware of ACL's but I don't really need acl. I want to accomplish this with conditions like this.
How to construct the conditions?
via VLS