Nov
24

$smarty->fetch 的使用 生成静态页面(ECSHOP)     2009

 11:36    1989    0   noel Ecshop/Ecmall/Smarty 不指定 | |
$smarty->fetch 的使用 生成静态页面

include("Smarty.class.php");$smarty = new Smarty;
$smarty->caching = true;
// only do db calls if cache doesn't exist// 只有在缓存不存在时才调用数据库if(!$smarty->is_cached("index.tpl")){
// dummy up some data $address = "245 N 50th"; $db_data = array(   "City" => "Lincoln",   "State" => "Nebraska",   "Zip" = > "68502"   );
$smarty->assign("Name","Fred"); $smarty->assign("Address",$address); $smarty->assign($db_data);
}
// capture the output// 捕获输出$output = $smarty->fetch("index.tpl");
// do something with $output here// 对将要输出的内容进行处理
echo $output;

作者:noel@淘宝网女装新款秋装连衣裙裤子外套上衣_2012时尚女装新款 Ecmall二次开发-PHP技术
地址:http://www.laohucheng.com/post/410/
版权所有©转载时必须以链接形式注明作者和原始出处及本声明!

引用(0)
发表评论
昵称 [注册]
密码 游客无需密码
网址
电邮
打开HTML 打开UBB 打开表情 隐藏 记住我