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