下面直接发代码复制代码代码如下:php/*file:config_smarty.php done:配置Smarty author:www.5dkx.com date:2009-12-21*/ include_once("../libs/smarty.class.php");class MySmarty extends Smarty{function __construct(){$this->Smarty();$this->config_dir = "../config";$this->cache_dir = "../cache";$this->template_dir = "../template";$this->compile_dir = "../template_c";$this->cache = false;}}$smart = new MySmarty();$smart->assign("title","标题");$smart->assign("content","内容");$smart->display('article.tpl');$output = $smart->fetch('article.tpl');$Path = "../html/1.html";$fp = fopen($Path,"w");fwrite($fp,$output);fclose($fp);?>
相关文章
- CodeIgniter框架怎么对接短信服务_CodeIgniter框架第三方API调用汇总【汇总】
- 如何在Golang中实现异步事件处理_Golang channel事件队列示例
- 架设简单的提供上载的网站(3)
- Python判断操作系统类型代码分享
- PHP编程数据结构怎么学_PHP数据结构学习方法【教程】
- 如何让Python类支持反向算术运算_实现__radd__等右侧运算符
- PHP生成静态页面实战_PHP构建静态化系统流程
- Tide Capital:比特币减半你需要知道的 6 个 Big Ideas
- C++ 根据宏定义自动化识别当前系统编译器的完整版本号及对照汇总全表【干货】
- 如何在宝塔面板配置HTTP/2协议?升级Nginx版本并开启SSL加密传输
