I am trying to set a value to a variable in play template and access it in the controller.
For ex, in homepage.scala.html
, I would like to set a pageName
variable a value as "homepage.scala.html"
.
Once I set this value in the play template, I want to access it in my controller which is presently in Java.
How do I achive this?
I will then be migrating the controller to scala. How do access the pageName value in scala controller?
Why I am trying to do this?: I am trying to apply Play Aloha editor to my application How to integrate the Aloha Wysiwyg Editor with Play! Framework. Here, when a static content on the page is edited, the page name is passed to central controller which then modifies the actual template page or even message resource to update the static content. If I can't or shouldn't pass the page name to the controller then how do I achieve this?
Many thanks.