1

我是新的游戏框架,我对这些问题有疑问,任何游戏框架专家都应该回答这些问题

In play framework the scala methods are how to invoke inside view ?

these method will create inside the application or model in the project

关于,Prasanth AR

my language is not good I know, and sorry about that
4

1 回答 1

4

要在 Twirl 的模板中定义方法@,请在名称和代码块之前添加

@incr(number: Int) = @{ @number + 1 }

要调用 scala 方法或变量@,请在名称前添加符号

<div>@incr(10)</div>

11将返回并在div块中打印

于 2013-06-01T05:35:12.423 回答