Heim >Backend-Entwicklung >PHP-Tutorial > smarty 怎么实现i++
smarty 如何实现i++
在html页面 smarty如何实现i++
如何把下面这段C#代码翻译成smarty下的代码?
<br /> <%<br /> int i_count = 0; <br /> foreach (GridViewRow row in this.GridView1.Rows)<br /> {<br /> if (i_count%4 == 0)<br /> {<br /> %><br /> <div>.1..<div><br /> <%<br /> }<br /> else<br /> {<br /> %><br /> <div>.2..<div><br /> <%<br /> }<br /> i_count ++ ;<br /> }<br /> %><br />
<br> <br> {assign var="i_count"}<br> {foreach from=$row item=item}<br> <br> {if $i_count mod 4}<br> <br> <div>.2..<div> <br> <br> {else}<br> <br> <div>.1..<div> <div class="clear"> </div> </div> </div> </div> </div>