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

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                <table cellspacing="0" cellpadding="0" border="0" width="100%" summary="Header navigation table"><tbody><tr><th align="center" colspan="3">Smarty - the compiling PHPtemplate engine</th> </tr><tr><td valign="bottom" align="left" width="25%"><a accesskey="P" href="api.createdata.html">Prev</a></td> <td valign="bottom" align="center" width="50%">Chapter 13. Smarty Class Methods()</td> <td valign="bottom" align="right" width="25%"><a accesskey="N" href="api.disableSecurity.html">Next</a></td> </tr></tbody></table> # createTemplate()[建立模板對象] Name createTemplate() ― returns a template object 返回一個模板對象 Description string createTemplate(string template,object parent); string createTemplate(string template, array data); string createTemplate(string template, string cache_id, string compile_id, object parent); string createTemplate(string template, string cache_id, string compile_id, array data); This creates a template object which later can be rendered by the display or fetch method. It uses the following parameters: template must be a valid template resource type and path. cache_id is an optional parameter. You can also set the $cache_id variable once instead of passing this to each call to this function. It is used in the event that you want to cache different content of the same template, such as pages for displaying different products. See also the caching section for more information. compile_id is an optional parameter. You can also set the $compile_id variable once instead of passing this to each call to this function. It is used in the event that you want to compile different versions of the same template, such as having separate templates compiled for different languages. parent is an optional parameter. It is an uplink to the main Smarty object, a user-created data object or to another user-created template object. These objects can be chained. The template can access only variables assigned to any of the objects in the parent chain. data is an optional parameter. It is an associative array containing the name/value pairs of variables which get assigned to the object. 本函數創建一個模板對象,該對象隨后可被[display()](#)或[fetch()](#)渲染。其參數如下: “template”必須是個有效的模板資源類型和路徑; “cache_id”是個可選參數,可以預先設置$cache_id變量,這樣就不必每次調用本函數時傳遞具體參數。它在同一模板需要緩存不同內容情況下使用,例如,分頁顯示不同的產品。更多信息參見[緩存](#)章節; “compile_id”是個可選參數。與“cache_id”一樣,可以預先將參數值分配給$compile_id變量,而不必每次調用本函數時傳遞具體參數。它在同一模板需要編譯不同版情況下使用,例如,將模板分開不同的語言(編碼)編譯時; “parent”是個可選參數。它負責上行鏈接至主Smarty對象、一個用戶自建數據對象或另一個用戶自建模板對象。這些對象支持鏈式,模板可以訪問賦值給其父鏈對象的變量。 “data”是個可選參數。它是個關聯數組,包含賦值給對象的變量組成的名稱/數值對。 <table class="EXAMPLE" cellspacing="0" cellpadding="0" border="0" width="100%"><tbody><tr><td> <div class="EXAMPLE"><strong><a name="AEN31315" id="AEN31315"/><span class="PROGRAMLISTING">Example 13.15. createTemplate()</span></strong><b><br/></b><table width="100%" bgcolor="#e0e0e0" border="0"><tbody><tr><td> <pre class="PROGRAMLISTING">&lt;?phpinclude('Smarty.class.php');$smarty = new Smarty;// create template object with its private variable scope$tpl = $smarty-&gt;createTemplate('index.tpl');// assign variable to template scope$tpl-&gt;assign('foo','bar');// display the template$tpl-&gt;display();?&gt;</pre></td> </tr></tbody></table><p><strong>譯者例:parent參數使用</strong></p> <table width="100%" bgcolor="#e0e0e0" border="0"><tbody><tr><td>test.php:<br/>include_once('../libs/Smarty.class.php');<br/>$smarty = new Smarty;<br/>$smarty-&gt;assign('abc','hello!');<br/> $tpl= $smarty-&gt;createTemplate('test.html',$smarty); //這里‘parent’為Smarty對象$smarty <br/>$tpl-&gt;display(); <br/><br/>test.html:<br/>{$abc}</td> </tr></tbody></table><p> 參見<a href="api.display.html">display()</a>和<a href="api.template.exists.html">templateExists()</a>。</p> </div> </td> </tr></tbody></table> <table cellspacing="0" cellpadding="0" border="0" width="100%" summary="Footer navigation table"><tbody><tr><td valign="top" align="left" width="33%"><a accesskey="P" href="api.createdata.html">Prev</a></td> <td valign="top" align="center" width="34%"><a accesskey="H" href="index.html">Home</a></td> <td valign="top" align="right" width="33%"><a accesskey="N" href="api.disableSecurity.html">Next</a></td> </tr><tr><td valign="top" align="left" width="33%">createData()<br/> 建立數據</td> <td valign="top" align="center" width="34%"><a accesskey="U" href="api.functions.html">Up</a></td> <td valign="top" align="right" width="33%">disableSecurity()<br/> 關閉安全檢查</td> </tr></tbody></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>

                              哎呀哎呀视频在线观看