Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I change template engine in Play Framework?

How would I change the template engine in Play! to a different engine than the default one? Can you give an example?

like image 509
trusktr Avatar asked Feb 22 '14 00:02

trusktr


2 Answers

I don't even ask why you want to do that.

That's simple, Play can return Result with ANY content you will give it, so you can just easily use:

return ok("<h1>Code rendered from your alternative engine</h1>").as("text/html");
like image 163
biesior Avatar answered Oct 23 '22 10:10

biesior


It depends on which template engine you want to use. There are a number of options in Play's Module Directory.

like image 21
James Ward Avatar answered Oct 23 '22 11:10

James Ward