我写了下面的代码,
我想要的是当变量为 4 时,创建一个新的<li>
. 在下面的代码中,{$counter} 总是 1 为什么?我不能增加它
<div id="slider">
<ul>
<li>
{foreach from=$books value=book}
{counter start=0 print=false assign=mycounter}
{ math equation="x + 1" x=$mycounter assign="counter" }
{$counter}
<div class="video2">
<div class="thumb">
<div class="kitap"><a href="http://cmkzl.nokta.com/kitaplar/{$book.title}"><img src="{$imageUrl}/{$book.image}" width="145" height="205"></a></div>
<div class="kitap_baslik"><strong>{$book.title}</strong></div>
<div class="alt_baslik"><em>{$book.description|truncate:65:"..."}</em></div>
<div class="yorumlar_btn"><a href="b_u_tirmanirken"><img src="{$imageUrl}/yorumlar_btn.jpg" width="145" height="50"></a></div>
</div>
</div>
</li>
{if $counter is div by 4}
<li>
{/if}
{/foreach}
</ul>
</div>