开发者

Grails conditional html

I was wondering how I can make this code in my view conditional - output it if there is a comment, but if there isn't a comment, don't output the empty 开发者_运维百科<p class="comment"></p>

<p class="comment">
  ${progressItem.comment}
</p>


<g:if test="${(progressItem?.comment?.size() > 0)}">
  <p class="comment">
    ${progressItem.comment}
  </p>
</g:if>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜