我正在使用Play 2.0和scala进行一个小项目,并且在显示逻辑方面有点挣扎。我想检查我的视图引擎中传递的参数是否为空。
我试过了:
@if(pmem.isEmpty()) {
there are no past members who won in this branch
} else {
<table>
etcc...
<table>
}
但它没有用,给了我一个
布尔值不接受参数错误
我也试过
@if(pmem == null) {
there are no past members who won in this branch
} else {
} else {
<table>
etcc...
<table>
}
它不起作用,也许我错过了什么?或者我可能做错了。我正在使用Scala / Play 2.0框架。
答案 0 :(得分:3)
@if(pmem.isEmpty) {
there are no past members who won in this branch
} else {
<table>
etcc...
<table>
}
尝试并给了我答案:)