<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.register.resource.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.unregisterfilter.html">Next</a></td> </tr></tbody></table> # templateExists()[模板是否存在] Name templateExists() ― checks whether the specified template exists 檢查指定的模板是否存在 Description bool templateExists(string template); It can accept either a path to the template on the filesystem or a resource string specifying the template. 它既可接收模板的文件路徑,也可接收指定的資源字符串作為參數。 **Example 13.31. templateExists()** <table width="100%" bgcolor="#e0e0e0" border="0"><tbody><tr><td><p> This example uses $_GET['page'] to {include} a content template. If the template does not exist then an error page is displayed instead. </p> <p>本例使用$_GET['page']去{include}包含一個內容模板。如果模板不存在,則顯示一個錯誤提示頁面。</p> <p>First the page_container.tpl<br/> &lt;html&gt;<br/> &lt;head&gt;&lt;title&gt;{$title}&lt;/title&gt;&lt;/head&gt;<br/> &lt;body&gt;<br/> {include file='page_top.tpl'}<br/> {* include middle content page *}<br/> {include file=$content_template}<br/> {include file='page_footer.tpl'}<br/> &lt;/body&gt;<br/><br/> And the php script //php腳本 </p> <p>&lt;?php<br/> // set the filename eg index.inc.tpl<br/> $mid_template = $_GET['page'].'.inc.tpl';<br/> if( !$smarty-&gt;templateExists($mid_template) ){<br/> $mid_template = 'page_not_found.tpl';<br/> }<br/> $smarty-&gt;assign('content_template', $mid_template);<br/> $smarty-&gt;display('page_container.tpl');<br/> ?&gt;</p> </td> </tr></tbody></table> 參見[display()](#)、[fetch()](#)、[{include}](#)和[{insert}](#)。 <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.register.resource.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.unregisterfilter.html">Next</a></td> </tr><tr><td valign="top" align="left" width="33%">registerResource()<br/> 注冊資源<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%">unregisterFilter()<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>

                              哎呀哎呀视频在线观看