twirl
twirl copied to clipboard
Twirl is Play's default template engine
Right now it's not possible to deprecate the generated `render`, `apply` and `f` methods. So we have no choice of breaking the API as soon the args passed via `@(...)`...
See - https://github.com/playframework/twirl/pull/461#issuecomment-1066378493 - https://github.com/lampepfl/dotty/issues/14691 - https://github.com/sbt/zinc/issues/1074#issuecomment-1073247308 Following commit could then be reverted eventually: https://github.com/playframework/twirl/commit/e892f83f9b97a56cddafd50e59bd88f9bbaf8557
Hi. I tried to inject ``` @import play.api.Play @this(configuration: com.typesafe.config.Config) @(error: Boolean) ``` into template to use it to obtain some information for footer. Problem is that compiled code results...
I have `"-Xfatal-warnings", "-Ywarn-unused-import",` in my scalacOptions I cannot use twirl ``` import play.twirl.api._ import play.twirl.api.TemplateMagic._ class error extends BaseScalaTemplate[play.twirl.api.HtmlFormat.Appendable,Format[play.twirl.api.HtmlFormat.Appendable]](play.twirl.api$ ```
Adding a scaladoc comment to the start of a template file like the example from the documentation: ``` @************************************* * Home page. * * * * @param msg The message...
- Use java.lang.StringBuilder instead of scala wrapper - Rewrite Html.buildString to use bulk copy methods when possible.
Fixes issue https://github.com/playframework/playframework/issues/6573.
Please add support for global template variables without ugly hacks as ```twirl @import java.lang.Boolean; val isAdmin = Templates.isAdmin(request) ```
```scala import play.twirl.api.StringInterpolation val test_seq = Seq(10,20,30) def test_div(i: Int) = html"$i" html""" ${test_div(-1)} ${test_seq.map(i => {test_div(i)})} """ ``` outputs ```html -1 <div>10</div><div>20</div><div>30</div> ``` While I expects ```html -1 102030...
Today I tried to make use of a scala.Option in my twirl template but found it rather hard / unelegant to use it in a nice way. what I had...