开发者

Toggle Login/Logout based on if user is already logged in

开发者 https://www.devze.com 2023-04-03 09:16 出处:网络
I have a Play! web application. If the user is logged in, I would like to show a \"Logout\" link in the top menu. If the user is not logged in, I\'d like to hi开发者_C百科de the \"Logout\" link and sh

I have a Play! web application. If the user is logged in, I would like to show a "Logout" link in the top menu. If the user is not logged in, I'd like to hi开发者_C百科de the "Logout" link and show a "Login" link instead. Easy, right? However, I am unable to find information on how to actually do this.

So, how would I go about this? I used the yabe web app as an example. Is there a #{secure.check} equivalent to check if the user has already logged in? What's the easiest way?

Help would be greatly appreciated, this is driving me nuts!


Quite simple :

#{if session.connected()}
0

精彩评论

暂无评论...
验证码 换一张
取 消