The Play framework Scala template engine repackaged for stand-alone use.
Questions tagged [twirl]
147 questions
2
votes
2 answers
How to add button handler in Scala Play framework?
I'm using scala play framework + scala template engine for front end. How can I add button handler? I need to call some function when clicking on it.
Database interface
2
votes
0 answers
Overloading template functions
I want to have a template function like:
@myInput("myLabel")
but that it can optionally take additional parameters like:
@myInput("myLabel", Validation.Max(5), Validation.Min(3).....)
and some sort of logic inside the template function, that…

lqbweb
- 1,684
- 3
- 19
- 33
2
votes
1 answer
Generate Scala Source from Twirl Template
I know play-twirl is used to generate Scala sources that contain template functions which can be called at runtime.
Is there a way to generate arbitrary Scala source files with play-twirl?
For example
I'd like to automate the creation of some…

Dylan
- 13,645
- 3
- 40
- 67
2
votes
2 answers
illegal start of simple expression
I am trying to execute a simple java program using play. I am getting a compilation error as illegal start of simple expression. I have searched answers for this question, but I didn't get it. My code looks like this:
@(products…

Rekha Ghasni
- 29
- 2
2
votes
1 answer
Code assistance in IntelliJ IDEA for implicit variables in Twirl Template
I am building a web app in Java using the Play! framework and Twirl template engine, using IntelliJ IDEA. In the template there are a number of implicit variables which are available(flash, session, requestHeader). I can successfully reference any…

JacksonWeekes
- 312
- 3
- 11
2
votes
1 answer
Rendering newline charactors from variable in Twirl
I have a toy Play framework project. And my Java code is something like:
String r = "apple\nbanana";
return ok(index.render(r));
And my index.scala.html is something like
@(r: String)