<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                企業??AI智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                <table summary="Header navigation table" width="100%" border="0" cellpadding="0" cellspacing="0"><tr><th colspan="3" align="center">Smarty - the compiling PHP template engine</th></tr><tr><td width="25%" align="left" valign="bottom"><a href="language.function.extends.html" accesskey="P">Prev</a></td> <td width="50%" align="center" valign="bottom">Chapter 7. Built-in Functions[第七章.內置函數]</td> <td width="25%" align="right" valign="bottom"><a href="language.function.foreach.html" accesskey="N">Next</a></td></tr></table> # {for} 循環 The {for}{forelse} tag is used to create simple loops. The following different formarts are supported: * {for $var=$start to $end} simple loop with step size of 1. * {for $var=$start to $end step $step} loop with individual step size. {forelse} is executed when the loop is not iterated. {for}、{forelse}標簽用來創建一個簡單循環,支持以下不同的格式: {for $var=$start to $end}步長為1的簡單循環; {for $var=$start to $end step $step}其它步長循環。 當循環無迭代時執行{forelse}。 **Attribute: ** | Attribute Name | Shorthand | Type | Required | Default | Description | |-----|-----|-----|-----|-----|-----| | max | n/a | integer | no | *n/a* | Limit the number of iterations | **Option Flags:** | **Name** | **Description** | |-----|-----| | nocache | Disables caching of the {for} loop | **屬性: ** | 屬性名 | 簡寫 | 類型 | 是否必須 | 缺省值 | 描述 | |-----|-----|-----|-----|-----|-----| | max | n/a | int | no | *n/a* | 迭代的最大次數 | **選項標記:** | **名稱** | **描述** | |-----|-----| | nocache | 禁止{for}循環緩存 | <table width="100%" border="0" cellpadding="0" cellspacing="0" class="EXAMPLE"><tr><td><div class="EXAMPLE"> <a name="AEN727" id="AEN727"> </a> <b><span class="PROGRAMLISTING">Example 7.27. A simple {for} loop</span><br/> 例 7-27.簡單的{for}</b><strong>循環</strong> <table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="PROGRAMLISTING">&lt;ul&gt;{for $foo=1 to 3} &lt;li&gt;{$foo}&lt;/li&gt;{/for}&lt;/ul&gt; The above example will output:&lt;ul&gt; &lt;li&gt;1&lt;/li&gt; &lt;li&gt;2&lt;/li&gt; &lt;li&gt;3&lt;/li&gt;&lt;/ul&gt;</pre></td> </tr></table><p><strong><span class="PROGRAMLISTING">Example 7.28. Using the max attribute</span><br/> 例 7-28.使用最大屬性</strong></p> <table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="PROGRAMLISTING">&lt;?php$smarty-&gt;assign('to',10);?&gt;&#13; &lt;ul&gt;{for $foo=3 to $to max=3} &lt;li&gt;{$foo}&lt;/li&gt;{/for}&lt;/ul&gt; The above example will output:&lt;ul&gt; &lt;li&gt;3&lt;/li&gt; &lt;li&gt;4&lt;/li&gt; &lt;li&gt;5&lt;/li&gt;&lt;/ul&gt;</pre></td> </tr></table><p><strong><span class="PROGRAMLISTING">Example 7.29. Excution of {forelse}</span><br/>例 7-28.執行{forelse}</strong></p> <table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="PROGRAMLISTING">$smarty-&gt;assign('start',10);$smarty-&gt;assign('to',5); &lt;ul&gt;{for $foo=$start to $to} &lt;li&gt;{$foo}&lt;/li&gt;{forelse} no iteration{/for}&lt;/ul&gt; The above example will output: no iteration&#13; </pre></td> </tr></table><p><span class="PROGRAMLISTING">See also {foreach} and {section}</span><br/> 參考<a href="language.function.foreach.html">{foeach}</a>與<a href="language.function.section.html">{section}</a>。<br/></p> </div></td> </tr></table> <table summary="Footer navigation table" width="100%" border="0" cellpadding="0" cellspacing="0"><tr><td width="33%" align="left" valign="top"><a href="language.function.extends.html" accesskey="P">Prev</a></td><td width="34%" align="center" valign="top"><a href="index.html" accesskey="H">Home</a></td><td width="33%" align="right" valign="top"><a href="language.function.foreach.html" accesskey="N">Next</a></td></tr><tr><td width="33%" align="left" valign="top">{extends}<br/> 繼承</td><td width="34%" align="center" valign="top"><a href="language.builtin.functions.html" accesskey="U">Up</a></td><td width="33%" align="right" valign="top">{foreach},{foreachelse}</td></tr></table>
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看