通过使用foreach遍历(权限)集合,我正在寻找特定的条件。所以,如果我找到了所有我需要的并且不再需要循环的东西,有没有办法跳出循环呢?我对velocity是个新手,正在尝试理解这种奇怪的语言。
#foreach ($perm in $space.getPermissions())
#end发布于 2010-01-01 14:48:12
Velocity的最新版本(1.6)包含一条语句#break
https://velocity.apache.org/engine/1.6.2/user-guide.html#Loops
## list first 5 customers only
#foreach( $customer in $customerList )
#if( $velocityCount > 5 )
#break
#end
$customer.Name
#endhttps://stackoverflow.com/questions/1628117
复制相似问题