广州传奇网络

地址:广州市天河区东圃大马路富华楼C座

电话:13808825895

邮箱:gz020wbs@163.com

QQ:1564443073

网址:http://www.020wbs.com/

首页 > 二次开发Ecshop二次开发 > ecshop smarty引擎用法

二次开发Ecshop二次开发

二次开发Ecshop二次开发

ecshop smarty引擎用法

下面是一段创建模板引擎的实例可以照此方法进行运行.ecshop中smarty模板引擎就这一个,但功能非常强大.接下来就可以比葫芦画瓢
require(ROOT_PATH . 'includes/cls_template.php');
$smarty = new cls_template;
$smarty->cache_lifetime = $_CFG['cache_time'];
$smarty->template_dir = ROOT_PATH . 'themes/' . $_CFG['template'];
$smarty->cache_dir = ROOT_PATH . 'temp/caches';
$smarty->compile_dir = ROOT_PATH . 'temp/compiled';
if ((DEBUG_MODE & 2) == 2)
{
$smarty->direct_output = true;
$smarty->force_compile = true;
}
else
{
$smarty->direct_output = false;
$smarty->force_compile = false;
}
$smarty->assign('lang', $_LANG);
$smarty->assign('ecs_charset', EC_CHARSET);
}