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

smarty 怎么实现i++

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-13 11:21:56
Original
897 people have browsed it

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 />
Copy after login



我写的是这样,但是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>
Copy after login
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template