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

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的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.block.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.capture.html" accesskey="N">Next</a></td></tr></table> # {call} 調用 {call} is used to call a template function defined by the {function} tag just like a plugin function. Otherwise you can directly use the function as {funcname ...} in the template. * The {call} tag must have the name attribute which contains the name of the template function. * Values for variables can be passed to the template function as attributes. {call}用來調用[{function}](#)標簽定義的模板函數,類似于插件函數。 <table width="80%" border="0" cellpadding="2" cellspacing="2" class="note"><caption> 提示 </caption> <tr><td>Note<br/> Template functions are defined global. Since the Smarty compiler is a single-pass compiler, The {call} tag must be used to call a template function defined externally from the given template.<br/> 模板函數具全局作用域,因為Smarty編譯器是單進程的編譯器,{call}標簽必須用來調用給定的外部模板定義的模板函數。</td> </tr></table> 另外你可以在模板中直接使用{funcname...}函數。 {call}標簽的屬性名須包含模板函數的名稱; 變量值可以通過模板函數作為屬性傳遞。 **Attribute: ** | Attribute Name | Type | Required | Default | Description | |-----|-----|-----|-----|-----| | name | string | yes | *n/a* | The name of the template function | | assign | string | no | n/a | The name of the variable that the output of called template function will be assigned to | | [var...] | [var type] | no | n/a | variable to pass local to template function | **option flags:** | **Name** | **Description** | |-----|-----| | nocache | Cakk the template function in nocache mode | **屬性: ** | 屬性名 | 類型 | 是否必須 | 缺省值 | 描述 | |-----|-----|-----|-----|-----| | name | string | yes | *n/a* | 模板函數名稱 | | assign | string | no | n/a | (模板函數的結果被貯存而不顯示),分配的輸出變量名 | | [var...] | [變量類型] | no | n/a | 傳遞給本地的模板函數變量 | **選項標簽:** | **名稱** | **描述** | |-----|-----| | nocache | 調用的模板函數為無緩存模式 | <table width="100%" border="0" cellpadding="0" cellspacing="0" class="EXAMPLE"><tr><td><div class="EXAMPLE"> <a name="AEN2720" id="AEN2720"> </a> <b>Example 7.20. Calling a recursive menu example<br/> 例 7-20.調用遞歸菜單例子</b> <table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><p> {* define the function *} {* 定義函數 *} <br/> {function name=menu level=0}<br/> &lt;ul class="level{$level}"&gt;<br/> {foreach $data as $entry}<br/> {if is_array($entry)}<br/> &lt;li&gt;{$entry@key}&lt;/li&gt;<br/> {call name=menu data=$entry level=$level+1}<br/> {else}<br/> &lt;li&gt;{$entry}&lt;/li&gt;<br/> {/if}<br/> {/foreach}<br/> &lt;/ul&gt;<br/> {/function}</p> <p><br/> {* create an array to demonstrate *}{*創建一個演示數組*}<br/> {$menu = ['item1','item2','item3' =&gt; ['item3-1','item3-2','item3-3' =&gt;['item3-3-1','item3-3-2']],'item4']}<br/> {* run the array through the function *}<br/> {call name=menu data=$menu}<br/> {call menu data=$menu} {* short-hand *}<br/><br/> Will generate the following output</p> <p>* item1<br/> * item2<br/> * item3<br/> --o item3-1<br/> --o item3-2<br/> --o item3-3<br/> ----+ item3-3-1<br/> ----+ item3-3-2<br/> * item4<br/></p></td> </tr></table> See also {function}<br/> 參見<a href="language.function.function.html">{function}</a></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.block.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.capture.html" accesskey="N">Next</a></td></tr><tr><td width="33%" align="left" valign="top">{block}<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">{capture}</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>

                              哎呀哎呀视频在线观看