<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="plugins.block.functions.html" accesskey="P">Prev</a></td><td width="50%" align="center" valign="bottom">Chapter 16. Extending Smarty With Plugins</td><td width="25%" align="right" valign="bottom"><a href="plugins.prefilters.postfilters.html" accesskey="N">Next</a></td></tr></table> # Compiler Functions[編譯函數] Compiler functions are called only during compilation of the template. They are useful for injecting PHP code or time-sensitive static content into the template. If there is both a compiler function and a custom function registered under the same name, the compiler function has precedence. 編譯函數僅在模板編譯期間被調用。編譯函數對于將PHP代碼或對時間敏感的靜態內容注入到模板時非常有用。如果同時注冊同名的編譯函數和自定義函數,則優先使用編譯函數。 mixed smarty_compiler_name($tag_arg, &$smarty); string $tag_arg; object &$smarty; The compiler function is passed two parameters: the tag argument string - basically, everything from the function name until the ending delimiter, and the Smarty object. It's supposed to return the PHP code to be injected into the compiled template. 編譯函數有兩個參數:參數string標簽――基本上包含從函數名稱到結束定界符的所有內容,另一個參數是Smarty對象。該函數將返回嵌入到編譯模板中的PHP代碼。 <table width="100%" border="0" cellpadding="0" cellspacing="0" class="EXAMPLE"><tr><td><div class="EXAMPLE"><a name="AEN4044"/><b>Example 16.6. simple compiler function<br/>例16-6.簡單編譯函數</b><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td> <p>&lt;?php<br/> /*<br/> * Smarty plugin<br/> * -------------------------------------------------------------<br/> * File: compiler.tplheader.php<br/> * Type: compiler<br/> * Name: tplheader<br/> * Purpose: Output header containing the source file name and<br/> * the time it was compiled.<br/> * -------------------------------------------------------------<br/> */<br/> function smarty_compiler_tplheader($tag_arg, $smarty)<br/> {<br/> return "\necho '" . $smarty-&gt;_current_file . " compiled at " . date('Y-m-d H:M'). "';";<br/> }<br/> ?&gt;</p> <p>This function can be called from the template as: 在模板中這樣調用編譯函數</p> <p>{* this function gets executed at compile time only *}<br/> {* 本函數僅在編譯運行時執行 *} <br/> {tplheader}<br/><br/> The resulting PHP code in the compiled template would be something like this: 返回給編譯模板的php代碼</p> <p>&lt;?php<br/> echo 'index.tpl compiled at 2002-02-20 20:02';<br/> ?&gt;</p> </td></tr></table><p> 參見<a href="api.registerplugin.html">registerPlugin()</a>、<a href="api.unregisterplugin.html">unregisterPlugin()</a>。</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="plugins.block.functions.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="plugins.prefilters.postfilters.html" accesskey="N">Next</a></td></tr><tr><td width="33%" align="left" valign="top">Block Functions<br/> 塊函數</td><td width="34%" align="center" valign="top"><a href="plugins.html" accesskey="U">Up</a></td><td width="33%" align="right" valign="top">Prefilters/Postfilters<br/> 預濾器/后濾器</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>

                              哎呀哎呀视频在线观看