开发者

How do I bind several actions to one template in Play! framework?

How do I bind several actions to one t开发者_运维百科emplate in Play! framework?


You can also use the renderTemplate method. It has the same parameter set as the render() method, passing in the template path as the first argument, but I find using this method makes it clearer in your code what exactly is being done.

renderTemplate("templateName", <variable number of parameters>)


You can user render to specify a template:

render("ControllerFolder/template.html",param1, param2);

Although be sure that's what you want to do, it may bring unexpected behaviour and may increase the cost of maintenance (changes to a method or to the template may impact the rest of the methods).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜