建站软件 优化软件 编程软件 网页辅助 站群程序 网站程序 图像处理 资源教程 字体下载 推荐软件


您的位置:首页 > PHP学习 > php中配置smarty

php中配置smarty

时间:2015-02-13 10:50:06  来源:免费模板网 作者:风雪 阅读次数 tagsphp中配置smarty

 
include "../libs/Smarty.class.php";  //引用smarty包  

可在官网下载最新的版本 http://www.smarty.net/
然后建立个php程序


require('Smarty.class.php');

$smarty = new Smarty;

$smarty->template_dir = '/web/smarty/templates/'; //设置模版目录
$smarty->compile_dir = '/web/smarty/templates_c/';//设置编译模版目录

$smarty->config_dir = '/web/smarty/configs/';
$smarty->cache_dir = '/web/smarty/cache/';//模版缓存地址

$smarty->assign('name','Ned');

$smarty->display('index.tpl');

然后在web/smarty/cache/新建一个index.tpl文件



本文地址:https://www.freemoban.com/php/2015/0213/543.html

猜你喜欢
栏目推荐
模板推荐

Copyright:www.freemoban.com 免费模板网 All Rights Reserved 网站备案:辽ICP备19014872号-2   辽公网安备 21010602000376号  辽公网安备:42900402000182号

免责声明:本站部分资源来自互联网收集,版权归原创者所有,如果侵犯了你的权益,我们会及时删除侵权内容,联系QQ:1615187561 谢谢合作!