How do I change template engine in Play Framework?

2019-04-29 14:33发布

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

2条回答
我只想做你的唯一
2楼-- · 2019-04-29 14:53

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

查看更多
姐就是有狂的资本
3楼-- · 2019-04-29 14:58

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");
查看更多
登录 后发表回答