smarty模板中get、post、request、cookies、session變數用法

來源:互聯網
上載者:User
  1. {$smarty.now|date_format:"%Y-%m-%d %H:%M:%S"}
複製代碼

2.{$smarty.const}可以直接存取PHP常量. 例如

  1. {$smarty.const._MY_CONST_VAL}
複製代碼

3.{$smarty.capture}可以通過 {capture}..{/capture}結構 截取的輸出可以使用{$smarty} 變數訪問.

4.{$smarty.config}{$smarty}變數 可以訪問已經載入的config變數例如 {$smarty.config.foo}就可以表示 {#foo#}

5.{$smarty.section}, {$smarty.foreach} {$smarty} 變數可以訪問'section'和'foreach'迴圈的屬性

6.{$smarty.template} 顯示當前被處理的模板的名字

7.{$smarty.version}顯示smarty模板的版本8.{$smarty.ldelim} 顯示左分隔字元9.{$smarty.rdelim} 顯示右分隔字元

  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.