scala - Can I call session in template/view on Play Framework -
i'm new @ using play framework 2.0 (i using scala) , have question sessions.
i come ruby on rails background, tend think of learn in play framework respect ruby on rails.
with in mind, there way me call stuff stored in session while in view?
if have "hello" -> "world" stored in session, want able @session.get("hello") , able use "world" in view. possible?
the other option see store value in variable in controller, , pass along view doing ok( var ), way seems kind of clunky if start using more variables.
thanks!
sessions in play store in cookies , cross-request data. if want can use @session.get("hello") might after way pass stuff controllers templates without having specify them parameters. in case, see detailed answer question here: https://stackoverflow.com/a/9632085/77409
Comments
Post a Comment