提供:一个一个非常有好用的Smarty配置类
<?php
define(‘PATH_PRE’,str_replace(‘\\’,'/’,dirname(__FILE__)).’/');
require_once PATH_PRE.’smarty/libs/Smarty.class.php’;
$smarty = new Smarty;
$smarty->force_compile = false;
$smarty->caching = false;
$smarty->template_dir = PATH_PRE . ‘templates’;
$smarty->compile_dir = PATH_PRE . ‘templates_c’;
function smartyDisplay($data,$template){
global $smarty;
$smarty->assign(‘data’,$data);
//echo $smarty->$template_dir;exit;
$smarty->display($template);
}
function smartyFetch($data,$template){
global $smarty;
$smarty->assign(‘data’,$data);
$tmp=$smarty->fetch($template);
}
?>
推荐阅读:smarty模板安装使用教程