最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

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

 更新時(shí)間:2010年04月12日 14:42:30   作者:  
看過Smarty,感覺這個(gè)東西很好用,但是不知道怎么生成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)文章

最新評論

永靖县| 莒南县| 铜鼓县| 长治县| 库伦旗| 中江县| 轮台县| 重庆市| 微博| 肥东县| 台南县| 买车| 英德市| 沅江市| 博兴县| 明光市| 永丰县| 两当县| 海丰县| 务川| 英山县| 天津市| 巍山| 浦县| 永州市| 三亚市| 九江市| 陇南市| 渝中区| 正阳县| 杭锦后旗| 宁安市| 巴青县| 清新县| 屏东县| 肥西县| 甘孜县| 女性| 新乡市| 南阳市| 朔州市|