页面缓存

缓存目录(caches_tmp/test.tmp.php)

模板页面(html/test.html)

$fileHtml = 'html/test.html';

$fileTpl = 'caches_tmp/test.tmp.php'

if(file_exist($fileTmp) && @filetime($fileTmp) > @filetime($fileHtml)) {

  return $fileTmp;

} esle {

$template_cache = &System::load_sys_class('template_cache');
if (!is_dir(dirname(dirname($FileTpl)))) {
mkdir(dirname(dirname($FileTpl)), 0777, true)or die("Not Dir");
chmod(dirname(dirname($FileTpl)), 0777);
}
if (!is_dir(dirname($FileTpl))) {
mkdir(dirname($FileTpl), 0777, true)or die("Not Dir");
chmod(dirname($FileTpl), 0777);
}
$PutFileTpl = $template_cache->template_init($FileTpl, $FileHtml, $module, $template);
if ($PutFileTpl)
return $FileTpl;
else
_error('template message', 'The "' . $module . '.' . $template . '" template file does not exist');

}

posted on 2016-04-21 15:40  IsRunning  阅读(196)  评论(0编辑  收藏  举报