$smarty = new Smarty;
$smarty->setTemplateDir("./templates/"); #设置新的模板目录,
$smarty->setCompileDir("./templates_c/"); #设置新的编译目录
$smarty->setCacheDir("./cache/"); #设置新的缓存目录
$smarty->caching = true; #设置缓存开启
$smarty->cache_lifetime = 300; #设置缓存有效时间
$smarty->left_delimiter = "<{"; #左分界符
$smarty->right_delimiter = "}>";
$smarty->assign('test', 123);
posted on 2017-12-15 10:28  JulyFairy  阅读(241)  评论(0)    收藏  举报