문제

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

도움이 되었습니까?

해결책

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");

다른 팁

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top