Is it possible to use the templating engine from the Play Framework in other contexts? Ideally I'd like an api of the form:
String result = render("template-file.html",var1,var2);
In some frameworks the templating engine is entirely usable outside of the framework, or even standalone.
I don't know if you can use templating engine outside Play context but you can generate the html page like this :
Map args = new HashMap();
args.put("var1",var1);
...
String html = TemplateLoader.load("contact.html",args).render();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With