码迷,mamicode.com
首页 > 其他好文 > 详细

smarty 入门2(个人总结)

时间:2016-08-31 11:43:10      阅读:106      评论:0      收藏:0      [点我收藏+]

标签:

1、下载安装;

2、拷贝libs文件夹到web文件夹;

3、引入smarty类文件   // include ‘./libs/Smarty.class.php‘;   

4、配置smarty      //a、配置模板文件 $smarty -> setTemplateDir("./mb/")  ; 

                          //b、配置编译后的文件 $smarty -> setCompileDir(‘./by/‘);

5、写入PHP代码 //a、将数据库发送到模板$smarty->assign("mb_str",$a);          *mb_str模板变量

                         b、引入模板文件$smarty -> display(qt.html);      *qt.html前端html

注意:

切记utf-8格式,中文乱码,前端页面挖坑{};

 

smarty 入门2(个人总结)

标签:

原文地址:http://www.cnblogs.com/panlaixing/p/5825058.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!