最新国产好看的视频,伊人天堂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)文章

最新評(píng)論

洪江市| 阜阳市| 新沂市| 容城县| 玛多县| 阜平县| 香河县| 辽宁省| 汤原县| 友谊县| 万安县| 石首市| 乐平市| 朝阳市| 南京市| 绥芬河市| 南川市| 武宣县| 上饶市| 大宁县| 元氏县| 黄骅市| 凤冈县| 荣成市| 延吉市| 阿坝| 邛崃市| 武宁县| 华池县| 泗水县| 中宁县| 平潭县| 游戏| 兴山县| 富川| 郧西县| 科技| 黔西县| 长海县| 普宁市| 平顺县|