<?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="}";
/*$arr=array("3wsdafasdf","ok","hah","news");
$smarty->assign("arr",$arr);
*/
date_default_timezone_set("PRC");
function insert_getTime()
{
return date("Y-m-d H:i:s");
}
/*
* smarty_block 函 數
* 先 得注冊一下才可以,
* 模 板裡這樣寫
*
* {myTag}
* {$smarty.now|date_format:'%Y-%m-%d %H:%M:%S'}
* {/myTag}
**/
function smarty_block_tag($params, $content, &$smarty)
{
return $content; //這裡一定要返回,要不不會顯 示。
}
$smarty->register_block("myTag","smarty_block_tag",false); // false 是表示不緩存
$smarty->display("index.tpl");
?>