注意:本文章只为做笔记,代码中可能存在遗漏和缺陷,仅供参考.
修改过的smarty文件,方便使用.
<?php
/**************************************/
//引用类文件
require '../smarty/libs/Smarty.class.php';
$smarty = new Smarty;
//设置各个目录的路径,这里是安装的重点
$smarty->template_dir ="../smarty/templates";
$smarty->compile_dir ="../smarty/templates_c";
$smarty->config_dir = "../smarty/config";
$smarty->cache_dir ="../smarty/cache";
$smarty->left_delimiter = "{#";
$smarty->right_delimiter = "#}";
//smarty模板有高速缓存的功能,如果这里是true的话即打开caching,但是会造成网页不立即更新的问题,当然也可以通过其他的办法解决
$smarty->caching = false;
/**************************************/
?>
smarty版本:smarty v3.1.29