<?php
require_once("./libs/Smarty.class.php");
$smarty=new Smarty();
$smarty->template_dir="./templates/";
$smarty->compile_dir="./templates_c/";
$smarty->cache_dir="./smarty_cache/";
$smarty->config_dir="./config/";
$smarty->caching=true;
$smarty->cache_lifetime=60;
$smarty->left_delimiter="{";
$smarty->right_delimiter="}";
date_default_timezone_set("PRC");
function insert_getTime()
{
return date("Y-m-d H:i:s");
}
function smarty_block_tag($params, $content, &$smarty)
{
return $content; //这里一定要返回,要不不会显 示。
}
$smarty->register_block("myTag","smarty_block_tag",false); // false 是表示不缓存
$smarty->display("index.tpl");
?>