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

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                <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.config.variables.html">Prev</a></td> <td width="50%" align="center" valign="bottom">Chapter 4. Variables[第四章.變量]</td> <td width="25%" align="right" valign="bottom"><a href="language.modifiers.html">Next</a></td></tr></table> [{$smarty} reserved variable]()[{$smarty}保留變量] **Table of Contents 內容列表**[Request variables](#)[頁面請求變量][{$smarty.now}](#)[{$smarty.const}](#)[{$smarty.capture}](#)[{$smarty.config}](#)[{$smarty.section}](#)[{$smarty.template}](#)[{$smarty.current_dir} ](#)[{$smarty.version}](#)[{$smarty.block.child} ](#)[{$smarty.block.parent} ](#)[{$smarty.ldelim}, {$smarty.rdelim}](#) The PHP reserved {$smarty} variable can be used to access several environment and request variables.The full list of them follows. 可以通過php保留變量{$smarty}訪問幾個環境和請求變量。列表如下。 Request variables The request variables [http://php.net/reserved.variables] such as $_GET, $_POST,$_COOKIE, $_SERVER, $_ENV and $_SESSION (see $request_vars_order and $request_use_auto_globals) can be accessed as demonstrated in the examples below: [請求變量](http://php.net/reserved.variables)諸如$_GET, $_POST,$_COOKIE, $_SERVER, $_ENV and $_SESSION (參考[$request_vars_order](#)和[$request_use_auto_globals](#)) 下面舉例說明他們的用法: **Example 4.8. Displaying request variables ** | ~~~ {* display value of page from URL ($_GET) http://www.example.com/index.php?page=fo{$smarty.get.page}{* display the variable "page" from a form ($_POST['page']) *}{$smarty.post.page}{* display the value of the cookie "username" ($_COOKIE['username']) *}{$smarty.cookies.username}{* display the server variable "SERVER_NAME" ($_SERVER['SERVER_NAME'])*}{$smarty.server.SERVER_NAME}{* display the system environment variable "PATH" *}{$smarty.env.PATH}{* display the php session variable "id" ($_SESSION['id']) *}{$smarty.session.id}{* display the variable "username" from merged get/post/cookies/server/env *}{$smarty.request.username} ~~~ | |-----| <table width="80%" border="0" cellpadding="2" cellspacing="2"><span class="note"> <caption> 提示 </caption> <tr><td><p>Note<br/> For historical reasons {$SCRIPT_NAME} is short-hand for {$smarty.server.SCRIPT_NAME}.<br/> &lt;a href="{$SCRIPT_NAME}?page=smarty"&gt;click me&lt;/a&gt; &lt;a href="{$smarty.server.SCRIPT_NAME}?page=smarty"&gt;click me&lt;/a&gt;。 <br/> 由于(版本的)歷史原因,{$SCRIPT_NAME}是{$smarty.server.SCRIPT_NAME}的簡寫。(參考php手冊$_SERVER中的'SCRIPT_NAME'元素)<br/> &lt;a href="{$SCRIPT_NAME}?page=smarty"&gt;click me&lt;/a&gt;、 &lt;a href="{$smarty.server.SCRIPT_NAME}?page=smarty"&gt;click me&lt;/a&gt;。</p> </td> </tr></span></table> <table width="80%" border="0" cellpadding="2" cellspacing="2"><span class="note"> <caption> 提示 </caption> <tr><td>Note<br/> Although Smarty provides direct access to PHP super globals for convenience, it should be used with caution. Specifically, GET and POST and REQUEST are commonly used for presentation purposes, but directly accessing SERVER, ENV, COOKIE and SESSION vars is typically avoided, as this is mixing underlying application code structure into the templates. A good practice is to assign specific needed values to template vars.<br/> 盡管Smarty提供了直接訪問php超級變量的便利,但仍需謹慎使用。一般來說,GET、POST和REQUEST通常用來直接取值,但更常用的方法是通過訪問SERVER、ENV、COOKIE、SESSION變量以防止(不安全值)混進模版底層代碼。一個好的習慣是給模板變量賦具體的初始值。</td> </tr></span></table> ? {$smarty.now} The current timestamp [http://php.net/function.time] can be accessed with {$smarty.now}. The value reflects the number of seconds passed since the so-called Epoch on January 1, 1970, and can be passed directly to the date_format modifier for display. Note that time() [http://php.net/function.time] is called on each invocation; eg a script that takes three seconds to execute with a call to $smarty.now at start and end will show the three second difference. {* use the date_format modifier to show current date and time *} 可以通過{$smarty.now}取得當前[時間戳](http://php.net/function.time)。返回自從Unix 紀元(格林威治時間 1970 年1月1日00:00:00)到當前時間的秒數,可以直接通過變量調節器[date_format](#)輸出顯示。應注意的是[time()](http://php.net/function.time)在每次觸發時被調用;例如,腳本執行完需要3秒鐘,在始末分別調用$smarty.now的話將顯示3秒的差異。 {$smarty.now|date_format:'%Y-%m-%d %H:%M:%S'} ? {$smarty.const} You can access PHP constant values directly. See also smarty constants. 你可以直接訪問php常量,參見[Smarty常量](#)。 | ~~~ <?php// the constant defined in phpdefine('MY_CONST_VAL','CHERRIES');?>Output the constant in a template with{$smarty.const.MY_CONST_VAL} <?php // php定義常量 define('MY_CONST_VAL','CHERRIES');?> 在模板中用{$smarty.const.MY_CONST_VAL}輸出常量 ~~~ | |-----| <table width="80%" border="0" cellpadding="2" cellspacing="2"><span class="note"> <caption> 提示 </caption> <tr><td>Note<br/> Although Smarty provides direct access to PHP constants for convenience, it is typically avoided as this is mixing underlying application code structure into the templates. A good practice is to assign specific needed values to template vars. <br/> 雖然Smarty提供了直接訪問php常量的便利,但它(Smarty式的模板常量)通常避免了在模板中混合php的做法,一個好的習慣是給模板變量賦特定的需求值。</td> </tr></span></table> ? {$smarty.capture} Template output captured via the built-in {capture}..{/capture} function can be accessed usingthe {$smarty.capture} variable. See the {capture} page for more information. 可以通過{$smarty.capture}變量捕獲內置的[{capture}](#)...{/capture}模版輸出。更多介紹參見[{capture}](#)一節。 ? {$smarty.config} {$smarty.config} variable can be used to refer to loaded config variables. {$smarty.config.foo} is a synonym for {#foo#}. See the {config_load} page for more info. {$smarty.config}可以取得配置變量。{$smarty.config.foo}是{#foo#}的同義詞。更多介紹參見[{config_load}](#)一節。 ? {$smarty.section} The {$smarty.section} variables can be used to refer to {section} loop properties. These have some very useful values such as .first, .index, etc. {$smarty.section}用來指向[{section}](#)循環的屬性,里面包含一些有用的值,比如.first/.index等。 <table width="80%" border="0" cellpadding="2" cellspacing="2"><span class="note"> <caption> 提示 </caption> <tr><td>Note<br/> The {$smarty.foreach} variable is no longer used with the new {foreach} syntax, but is still supported with Smarty 2.x style foreach syntax.<br/> {$smarty.foreach}變量不再是新{foreach}函數的值,但Smarty 2.x版仍然支持foreach風格的語法。</td> </tr></span></table> ? {$smarty.template} Returns the name of the current template being processed (without the directory.) 返回經過處理的當前模板名(不包括目錄)。 ? {$smarty.current_dir} Returns the name of the directory for the current template being processed. 返回經過處理的當前模板目錄名。 ? **{$smarty.version}** Returns the version of Smarty the template was compiled with. 返回經過編譯的Smarty模板版本號。 | <div id="footer">Powered by Smarty {$smarty.version}</div> | |-----| ? {$smarty.block.child} Returns block text from child template. See Template interitance. 返回子模版文本塊。參見[模板繼承](#)。 ? {$smarty.block.parent} Returns block text from parent template. See Template interitance 返回父模版文本塊。參見[模板繼承](#)。 ? {$smarty.ldelim}, {$smarty.rdelim} These variables are used for printing the left-delimiter and right-delimiter value literally, the same as {ldelim},{rdelim}. See also assigned variables and config variables 這兩者變量用來打印left-delimiter和right-delimiter的字面值,等同于[{ldelim}](#)、[{rdelim}](#)。 另參閱[assigned](#)變量和[config](#)變量。 <table width="100%" border="0" cellpadding="0" cellspacing="0"><tr><td width="33%" align="left" valign="top"><a href="language.config.variables.html">Prev</a></td><td width="34%" align="center" valign="top"><a href="index.html">Home</a></td><td width="33%" align="right" valign="top"><a href="language.modifiers.html">Next</a></td></tr><tr><td width="33%" align="left" valign="top">Variables loaded from config files<br/> 從配置文件讀取的變量</td> <td width="34%" align="center" valign="top"><a href="language.variables.html">Up</a></td> <td width="33%" align="right" valign="top">Variable Modifiers<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>

                              哎呀哎呀视频在线观看