【发布时间】:2017-03-13 16:36:14
【问题描述】:
使用 PlayFramework,在我的 twirl 模板中,假设我有一个函数 canBeDone(List, List),我如何声明和使用这个函数以便它返回一个布尔值?
我的想法是我有一些代码
@if(canBeDone(list1, list2){
...
} ...
并像这样声明(在我的旋转模板顶部):
@canBeDone(list1: List, list2:List) = {
...
}
但是当我运行它时,我得到了这个错误:
type mismatch; found : play.twirl.api.HtmlFormat.Appendable (which expands to) play.twirl.api.Html required: Boolean
我该如何解决这个问题?
【问题讨论】:
标签: playframework