php smarty模板生成静态html页面代码
代码如下 | |
include('./www.111cn.net/smarty/smarty.class.php'); $db = mysql教程_connect('localhost','root',''); |
//模板页面
代码如下 | |
<!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>无标题文档</title> </head> <body> <{section name=n loop=$news}> id <{$news[n].news_id}><br /> title <{$news[n].news_title}> <br /> content<{$news[n].news_content}> <hr /> <{sectionelse}> 暂时没有新闻 <{/section}> </body> </html> |
您可能感兴趣的文章:
有关smarty模板引擎生成静态页的关键代码
php模版生成html的小例子
smarty获得当前url示例代码
PHP中使用smarty生成静态文件的例子
smarty生成静态页面的方法
php smarty 基础
php生成静态页面的三种方法与代码详解
PHP模板引擎Smarty缓存使用
PHP模板引擎smarty生成随机数 smarty中math函数用法
php Smarty的缓存操作