【问题标题】:how to write a WHILE loop in Rythm如何在 Rythm 中编写 WHILE 循环
【发布时间】:2012-07-15 14:20:27
【问题描述】:

我尝试在 HTML 标记中的 Rythm 中编写 While 循环,但我不能

类似这样的代码:

@{
int i = 0;
while( i< 5){
i++;
}

<h2>hello</h2>

@{
}
}

【问题讨论】:

    标签: java template-engine templating rythm


    【解决方案1】:

    目前Rythm不支持while循环。使用 for 循环代替您的情况:

    @for(int i = 0; i < 5; ++i) {
        <h2>hello</h2>
    }
    

    【讨论】:

      猜你喜欢
      • 2020-08-14
      • 2015-06-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-09-07
      • 1970-01-01
      • 1970-01-01
      • 2013-07-24
      相关资源
      最近更新 更多