开发者

Grails conditional html

开发者 https://www.devze.com 2023-04-09 08:45 出处:网络
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\"><

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

精彩评论

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