【发布时间】:2012-08-23 19:34:29
【问题描述】:
我在 scala 中编写可重用代码时遇到问题。
如果我有类似的东西
@helper.form(action = routes.Guides.addComment(category,title)) {
有没有办法用变量替换它?
伪代码
@(func : Function)
@helper.form(action = func) {
编辑:
哦....现在有点明显了。函数本身应该返回一个字符串,所以我想我可以这样说
@(func :String)
..
.
return ok (form.render(routes.Guides.test()))
现在测试
【问题讨论】:
标签: java templates scala playframework-2.0