Smarty 傳遞的參數

Smarty都能傳遞什麼參數

普通變量  string bool int

數組  array

常量  define、const定義的

系統常量  等等

 

 

Smarty全局變量接收

    <!-- 接收GET傳遞的參數id -->
    {$smarty.get.id}    

php 頁面中傳遞值,smarty在html中能接收到

http://localhost/Smartry/controller.php?id=33

常量

    {$smarty.const.CC}
<?php 
include './Vendor/Smarty.class.php';
$smart=new Smarty();
define("CC","中國製造");

$smart->display('my.html');

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章