smarty.inc.phpphp
<?php緩存
//建立一個實際路徑
define('ROOT_PATH',dirname(__FILE__));
//引入Smarty
require ROOT_PATH.'/smarty/Smarty.class.php';網站
//建立一個Smarty對象
$_smarty = new Smarty();
//模板目錄
$_smarty->template_dir = ROOT_PATH.'/templates/';
//編譯目錄
$_smarty->compile_dir = ROOT_PATH.'/templates_c/';
//配置變量目錄
$_smarty->config_dir = ROOT_PATH.'/configs/';
//緩存目錄
$_smarty->cache_dir = ROOT_PATH.'/cache/';
//是否開啓緩存,網站開發調試階段,咱們應該關閉緩存
$_smarty->caching = 1;
//緩存的聲明週期
$_smarty->cache_lifetime = 60*60*24;
//左定界符
$_smarty->left_delimiter = '{';
//右定界符
$_smarty->right_delimiter = '}';
?>ui