<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 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.syntax.attributes.html" accesskey="P">Prev</a></td> <td width="50%" align="center" valign="bottom">Chapter 3. Basic Syntax[第3章.基本語法]</td> <td width="25%" align="right" valign="bottom"><a href="language.math.html" accesskey="N">Next</a></td></tr></table> # Embedding Vars in Double Quotes[雙引號里嵌入變量] Smarty will recognize assigned variables embedded in "double quotes" so long as the variable name contains only numbers, letters and under_scores. See naming [http://php.net/language.variables] for more detail. With any other characters, for example a .period or $object>reference, then the variable must be surrounded by `backticks`. In addition Smarty3 does allow embedded Smarty tags in double quoted strings. This is usefull if you want to include variables with modifers, plugin or PHP function results. Smarty可以識別嵌入在雙引號中的變量,只要此變量只包含數字、字母、下劃線和中括號[],詳細資料參考php[命名](http://php.net/language.variables)。 對于其他的符號(句號、對象引用等等)此變量必須用兩個反引號`(此符號和~'在同一個鍵上,一般在ESC鍵下面)包住。 Smarty3增加了雙引號對Smarty標簽的支持。在需要包含調節器變量、插件、php函數返回值的情形中非常實用。 <table width="100%" border="0" cellpadding="0" cellspacing="0" class="EXAMPLE"><tr><td><div class="EXAMPLE"><a name="AEN194"/> <b><span class="PROGRAMLISTING">Example 3.5. Syntax examples</span><br/></b><strong>例 3-5.語法示例 </strong> <table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre>{func var="test $foo test"} // sees $foo{func var="test $foo_bar test"} // sees $foo_bar{func var="test `$foo[0]` test"} // sees $foo[0]{func var="test `$foo[bar]` test"} // sees $foo[bar]{func var="test $foo.bar test"} // sees $foo (not $foo.bar) Smarty只識別變量$foo,其它按原文輸出{func var="test `$foo.bar` test"} // sees $foo.bar 加了反引號,Smarty能識別變量$foo.bar{func var="test `$foo.bar` test"|escape} // modifiers outside quotes! 調節器在引號外{func var="test {$foo|escape} test"} // modifiers inside quotes! 調節器在引號內{func var="test {time()} test"} // PHP function result{func var="test {counter} test"} // plugin result{func var="variable foo is {if !$foo}not {/if} defined"} // Smarty block function</pre></td></tr></table><p><b>Example 3.6. Examples<br/></b><strong>例 3-6.示例 </strong></p> <table border="0" bgcolor="#E0E0E0" width="100%"><tr><td> {* will replace $tpl_name with value *}<br/> {include file="subdir/$tpl_name.tpl"}<br/> {* does NOT replace $tpl_name *}<br/> {include file='subdir/$tpl_name.tpl'} // vars require double quotes! 需要使用雙引號<br/> {* must have backticks as it contains a dot "." *} {* 須用反引號,因為引號里面包含“.” *} <br/> {cycle values="one,two,`$smarty.config.myval`"}<br/> {* must have backticks as it contains a dot "." *}<br/> {include file="`$module.contact`.tpl"}<br/> {* can use variable with dot syntax *}<br/> {include file="`$module.$view`.tpl"}</td> </tr></table><table width="80%" border="0" cellpadding="2" cellspacing="2" class="note"><caption> 提示 </caption> <tr><td><p>Note<br/> Although Smarty can handle some very complex expressions and syntax, it is a good rule of thumb to keep the template syntax minimal and focused on presentation. If you find your template syntax getting too complex, it may be a good idea to move the bits that do not deal explicitly with presentation to PHP by way of plugins or modifiers.<br/> 雖然Smarty能處理一些復雜的表達式和語法,但從經驗上來說的,一個好的做法是最低限度使用模版語法,將其專注于表現外在內容。如果發現你的模版語法太復雜,最好將與外在表現無關的后臺處理通過插件或調節器交給php處理。<br/></p> </td> </tr></table><p>See also escape.<br/> 更多相關參考<a href="language.modifier.escape.html">escape</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="language.syntax.attributes.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.math.html" accesskey="N">Next</a></td></tr><tr><td width="33%" align="left" valign="top">Attributes<br/> 屬性 </td> <td width="34%" align="center" valign="top"><a href="language.basic.syntax.html" accesskey="U">Up</a></td><td width="33%" align="right" valign="top">Math<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>

                              哎呀哎呀视频在线观看