亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

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

 更新時間:2010年04月12日 14:42:30   作者:  
看過Smarty,感覺這個東西很好用,但是不知道怎么生成html文檔。今天在網(wǎng)上查了下,找了方法
下面直接發(fā)代碼
復(fù)制代碼 代碼如下:

<?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","標(biāo)題");
$smart->assign("content","內(nèi)容");
$smart->display('article.tpl');
$output = $smart->fetch('article.tpl');
$Path = "../html/1.html";
$fp = fopen($Path,"w");
fwrite($fp,$output);
fclose($fp);
?>

相關(guān)文章

最新評論