开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜