php smarty的預保留變數總結_PHP教程

來源:互聯網
上載者:User
以下是訪問頁面請求變數諸如get,post,cookies,server,enviroment和session變數的例子. 例如{$smarty.server.SERVER_NAME}取得伺服器變數,{$smarty.env.PATH}取得系統內容變數path, {$smarty.request.username}取得get/post/cookies/server/env的複合變數。
{$smarty.now}變數用於訪問目前時間戳.
可以用 date_format調節器格式化輸出. 例如{$smarty.now|date_format:"%Y-%m-%d %H:%M:%S"}
{$smarty.const}
你可以直接存取PHP常量. 例如{$smarty.const._MY_CONST_VAL}
{$smarty.capture}
可以通過 {capture}..{/capture}結構 截取的輸出可以使用{$smarty} 變數訪問.
{$smarty.config}
{$smarty}變數 可以訪問已經載入的config變數.
例如 {$smarty.config.foo}就可以表示 {#foo#}.
{$smarty.section}, {$smarty.foreach}
{$smarty} 變數可以訪問'section'和'foreach'迴圈的屬性.
{$smarty.template}
顯示當前被處理的模板的名字.
{$smarty.version}
顯示smarty模板的版本
{$smarty.ldelim}
顯示左分隔字元
{$smarty.rdelim}
顯示右分隔字元

http://www.bkjia.com/PHPjc/319722.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/319722.htmlTechArticle以下是訪問頁面請求變數諸如get,post,cookies,server,enviroment和session變數的例子. 例如{$smarty.server.SERVER_NAME}取得伺服器變數,{$smarty.env.PATH}取得系...

  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.