第一次运行的时候不报错刷新一下就报错
cache.tpl
{name}
嘿嘿 我是被缓存的哟
index.php
<?php
require_once ("./libs/Smarty.class.php");
function smarty_function_name($params,&$smarty){
    return date("Y-m-d H:m:s")."<br>";
}
$smarty = new Smarty();
$smarty->template_dir = './templates/';
$smarty->compile_dir = './templates_c/';
$smarty->config_dir = './configs/';
$smarty->cache_dir = './cache/';
$smarty->cache_lifetime =2;
$smarty->caching = true;
$smarty->register_function("name","smarty_function_name",false);
$smarty->display('cache.tpl');
?>
报错内容如下:
Warning: Smarty::include_once(./templates_c/\%%E8^E8A^E8A3669C%%cache.tpl.inc) [function.Smarty-include-once]: failed to open stream: No such file or directory in D:\AppServ\www\smarty\libs\Smarty.class.php on line 1923Warning: Smarty::include_once() [function.include]: Failed opening './templates_c/\%%E8^E8A^E8A3669C%%cache.tpl.inc' for inclusion (include_path='.;D:\AppServ\php5\pear') in D:\AppServ\www\smarty\libs\Smarty.class.php on line 1923
{nocache:68f51390ee008f2ec19b4ca13351358b#0} 嘿嘿 我是被缓存的哟