How would I change the template engine in Play! to a different engine than the default one? Can you give an example?
Asked
Active
Viewed 1,795 times
2 Answers
4
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");
![](../../users/profiles/1066240.webp)
biesior
- 54,554
- 10
- 118
- 177
-
1As per motivation, other template engines may just be more favorable. – matanster Dec 07 '14 at 23:37
4
It depends on which template engine you want to use. There are a number of options in Play's Module Directory.
![](../../users/profiles/77409.webp)
James Ward
- 28,966
- 9
- 47
- 79
-
Nothing really fancily maintained there in terms of good template engine integrations... – matanster Dec 07 '14 at 23:43