Home >Backend Development >PHP Tutorial > smarty 怎么实现i++

smarty 怎么实现i++

WBOY
WBOYOriginal
2016-06-13 12:48:10713browse

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 />



我写的是这样,但是ERROR

<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>
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn