[2.0-Scala] Session from template

300 views
Skip to first unread message

Meeraj Kunnumpurath

unread,
Apr 25, 2012, 3:07:00 PM4/25/12
to play-fr...@googlegroups.com
Hi,

Is there anyway I can implicitly access the current session from a scala template?

Thanks
Meeraj

Julien Richard-Foy

unread,
Apr 25, 2012, 5:17:24 PM4/25/12
to play-fr...@googlegroups.com
You can pass the session as a parameter to your templates.

oblivion

unread,
Apr 25, 2012, 5:18:07 PM4/25/12
to play-framework
Yes, something like this:

@(nav: => Html)(implicit session:play.api.mvc.Session)

On Apr 25, 9:07 pm, Meeraj Kunnumpurath

Meeraj Kunnumpurath

unread,
Apr 25, 2012, 5:39:36 PM4/25/12
to play-fr...@googlegroups.com
Thank you, that is what I am doing now. It is looking a bit invasive. I thought it would be good to have something similar to JSP implicit variables.

Regards
Meeraj

--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To post to this group, send email to play-fr...@googlegroups.com.
To unsubscribe from this group, send email to play-framewor...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/play-framework?hl=en.


Reply all
Reply to author
Forward
0 new messages