php Smarty模板生成html文档的方法

下面直接发代码
<div class="codetitle"><a style="CURSOR: pointer" data="4752" class="copybut" id="copybut4752" onclick="doCopy('code4752')"> 代码如下:

<div class="codebody" id="code4752">
<?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);
?>

相关文章

统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...
统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...
前言 之前做了微信登录,所以总结一下微信授权登录并获取用户...
FastAdmin是我第一个接触的后台管理系统框架。FastAdmin是一...
之前公司需要一个内部的通讯软件,就叫我做一个。通讯软件嘛...
统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...