在我的模板中,我遍歷了一系列元素。有些情況下我想在這些循環中使用break;
或continue;
。我怎樣才能在模板語言中做到這一點?playframework:相當於Java的繼續和休息的模板?
我一直在檢查文檔在這裏:http://www.playframework.org/documentation/1.0.2.1/tags但我似乎無法找到任何有關我將如何打破或繼續的信息。下面是兩個示例使用案例:
#{list items:myList as:'my'}
#{if my.name == "hello"}
//Do something
//I'd like to break here.
#{/if}
#{/list}
也是後來在我的代碼我有一個嵌套列表迭代是這樣的...
#{list items:item, as:'i'}
#{list items:anotherItem, as:'aI'}
#{if i.name != aI.name}
//Do Something here.
//I'd like to continue here.
#{/if}
#{/list}
#{/list}
繼續
只是一個額外的問題..我可以用.contains();
這樣的列表做些什麼嗎?有人知道這種語言的不錯指南嗎?