把smarty配置更加詳細完善了下,呵呵,發上來了!!

<?php
include_once("smarty/Smarty.class.php"); //包含smarty類文件
$smarty = new Smarty(); //建立smarty實例對象$smarty
$smarty->config_dir="Smarty/Config_File.class.php";  // 目錄變量
$smarty->caching=false; //是否使用緩存,項目在調試期間,不建議啓用緩存
$smarty->template_dir = "./templates"; //設置模板目錄
$smarty->compile_dir = "./templates_c"; //設置編譯目錄
$smarty->cache_dir = "./smarty_cache"; //緩存文件夾
$smarty->caching=true; //開啓緩存,爲flase的時候緩存無效
$smarty->cache_lifetime= 60;

//----------------------------------------------------
//左右邊界符,默認爲{},但實際應用當中容易與JavaScript相沖突
//----------------------------------------------------
$smarty->left_delimiter = "{";
$smarty->right_delimiter = "}";
?>

發佈了29 篇原創文章 · 獲贊 0 · 訪問量 4萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章