开发者

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

开发者 https://www.devze.com 2023-03-29 14:50 出处:网络
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 templat

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

精彩评论

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