【php开源代码栏目提醒】:网学会员php开源代码为您提供SmartyTemplate.php参考,解决您在SmartyTemplate.php学习中工作中的难题,参考学习。
<?php
/*
Plugin Name: SmartyTemplate
Template URI: http://smarty.php.net
Description: Smarty妯$増寮曟搸鎻掍欢
Author: 娴佸勾 淇 浜戜腑闆?
Version: 1.0
Author URI: http://blog.liu21st.com/
*/
function SmartyTemplate($templateFile,$templateVar,$charset,$varPrefix='')
{
$templateFile=substr($templateFile,strlen(TMPL_PATH));
include_once(PLUGIN_PATH."SmartyTemplate/Smarty.class.php");
$tpl = new Smarty();
$tpl->caching = true;
$tpl->template_dir = TMPL_PATH;
$tpl->compile_dir = CACHE_PATH ;
$tpl->cache_dir = TEMP_PATH ;
$tpl->assign($templateVar);
$tpl->display($templateFile);
return ;
}
if('SMARTY'== strtoupper(C('TMPL_ENGINE_TYPE'))) {
add_compiler('Smarty','SmartyTemplate');
}
?>