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

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                <table cellspacing="0" cellpadding="0" width="100%" summary="Header navigation table" border="0"><tbody><tr><th align="middle" colspan="3">Smarty - the compiling PHP template engine</th></tr><tr><td valign="bottom" align="left" width="25%"><a accesskey="P" href="getting.started.html">Prev</a></td> <td valign="bottom" align="middle" width="50%"/> <td valign="bottom" align="right" width="25%"><a accesskey="N" href="installation.html">Next</a></td></tr></tbody></table> # Chapter 1. What is Smarty? 第一章.什么是Smaty? Smarty is a template engine for PHP. More specifically, it facilitates a manageable way to separate application logic and content from its presentation. This is best described in a situation where the application programmer and the template designer play different roles, or in most cases are not the same person. For example, let's say you are creating a web page that is displaying a newspaper article. * The article $headline, $tagline, $author and $body are content elements, they contain no information about how they will be presented. They are passed into Smarty by the application. * Then the template designer edits the templates and uses a combination of HTML tags and template tags to format the presentation of these variables with elements such as tables, div's, background colors, font sizes, style sheets, svg etc. * One day the programmer needs to change the way the article content is retrieved, ie a change in application logic. This change does not affect the template designer, the content will still arrive in the template exactly the same. * Likewise, if the template designer wants to completely redesign the templates, this would require no change to the application logic. * Therefore, the programmer can make changes to the application logic without the need to restructure templates, and the template designer can make changes to templates without breaking application logic. One design goal of Smarty is the separation of business logic and presentation logic. * This means templates can certainly contain logic under the condition that it is for presentation only.Things such as including other templates, alternating table row colors, upper-casing a variable, looping over an array of data and displaying it are examples of presentation logic. * This does not mean however that Smarty forces a separation of business and presentation logic. Smarty has no knowledge of which is which, so placing business logic in the template is your own doing. * Also, if you desire no logic in your templates you certainly can do so by boiling the content down to text and variables only. Smarty是一個php模板引擎。更準確的說,它分開了邏輯程序和外在的內容,提供了一種易于管理的方法。可以描述為應用程序員和美工扮演了不同的角色,因為在大多數情況下,他們不可能是同一個人。 例如,你正在創建一個用于瀏覽新聞的網頁。 * 新聞標題、標簽欄、作者和內容等變量都是內容要素,他們并不包含應該怎樣呈現的信息。而這些正是Smarty要做的。 * 模板設計者們編輯模板,組合使用html標簽和模板標簽去格式化這些要素的輸出(html表格,背景色,字體大小,樣式表,等等)。 * 有一天程序員想要改變文章檢索的方式(也就是程序邏輯的改變)。這個改變不影響模板設計者,內容仍將準確的輸出到模板。 * 同樣的,哪天美工吃多了想要完全重做界面,也不會影響到程序邏輯。 * 因此,程序員可以改變邏輯而不需要重新構建模板,模板設計者可以改變模板而不影響到邏輯。 Smarty總的設計理念就是分離業務邏輯和表現邏輯。 * 這意味著模版在只為表現外在內容而存在的前提下必定包含邏輯。諸如載入其它模版、交替顯示表格行顏色、大寫變量、循環數據數組并將其顯示出來,此謂模版的表現邏輯的例子。 * 但這并不意味著Smarty強制分離業務邏輯和表現邏輯。Smarty不具備分清誰是誰的能力,因此只要你高興,你照樣可以將業務邏輯放入模版。 * 此外,如果你希望在模版中不包含邏輯,你當然可以只將內容加工為文本和變量。 Some of Smarty's features: Smaty的一些特點: - It is extremely fast. 非常非常的快! - It is efficient since the PHP parser does the dirty work. 用php分析器干這個苦差事是有效的 - No template parsing overhead, only compiles once. 不需要多余的模板語法解析,僅僅是編譯一次 - It is smart about recompiling only the template files that have changed. 僅對修改過的模板文件進行重新編譯 - You can make [custom functions](#) and custom [variable modifiers](#), so the template language is extremely extensible. 可以編輯'自定義函數'和自定義'變量',因此這種模板語言完全可以擴展 - Configurable template delimiter tag syntax, so you can use {}, {{}}, <!--{}-->, etc. 可以自行設置模板定界符,所以你可以使用{}, {{}}, <!--{}-->, 等等 - The if/elseif/else/endif constructs are passed to the PHP parser, so the {if ...} expression syntax can be as simple or as complex as you like. 諸如 if/elseif/else/endif 語句可以被傳遞到php語法解析器,所以 {if ...} 表達式是簡單的或者是復合的,隨你喜歡啦 - Allows unlimited nesting of sections, if's etc. 可以無限嵌套sections、if等。 - Built-in caching support 內建緩存支持 - Arbitrary template sources 獨立模板文件 - Custom cache handling functions 可自定義緩存處理函數 - Template Inheritance for easy management of template content. 模板繼承易于管理模板內容 - Plugin architecture 插件體系結構 <table cellspacing="0" cellpadding="0" width="100%" summary="Footer navigation table" border="0"><tbody><tr><td valign="top" align="left" width="33%"><a accesskey="P" href="getting.started.html">Prev</a></td> <td valign="top" align="middle" width="34%"><a accesskey="H" href="index.html">Home</a></td> <td valign="top" align="right" width="33%"><a accesskey="N" href="installation.html">Next</a></td></tr><tr><td valign="top" align="left" width="33%">Getting Started<br/> 開始</td> <td valign="top" align="middle" width="34%"><a accesskey="U" href="getting.started.html">Up</a></td> <td valign="top" align="right" width="33%">Installation<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>

                              哎呀哎呀视频在线观看