教程集 www.jiaochengji.com
教程集 >  脚本编程  >  php  >  正文 php smarty 模板section入门教程与实例

php smarty 模板section入门教程与实例

发布时间:2023-05-11   编辑:jiaochengji.com
教程集为您提供php smarty 模板section入门教程与实例等资源,欢迎您收藏本站,我们将为您提供最新的php smarty 模板section入门教程与实例资源
 代码如下

include("smarty_inc.php");
include("config.php");

$rzlysql = "SELECT * FROM `log_reply`";
$rzlyr = mysql教程_query($rzlysql,$conn);
while($nam=mysql_fetch_array($rzlyr)){
$name[] = array("id" => $nam["id"], "info" => $nam["info"], "ip" => $nam["ip"], "time" => $nam["time"], "Reply" => $nam["Reply"] );
}
$smarty->assign("title",$name);
$smarty->display("index.html");

?>

然后是 index,html

 代码如下
<body>
<{section name=y loop=$name}>
<{$title[y].id}> - <{$title[y].info}> - <{$title[y].ip}> - <{$title[y].time}> - <{$title[y].Reply}>
<{sectionelse}>
www.111cn.net
<{/section}>
</body>

您可能感兴趣的文章:
smarty 模板if else使用实例与入门教程
有关smarty的基本设置
php smarty 基础
smarty结合xajax检测用户名
php模版生成html的小例子
smarty获得当前url示例代码
smarty结合xajax检测用户名简单实例
如何将smarty安装到MVC架构中(代码示例)
PHP模板引擎Smarty缓存使用
smarty模板中类似for循环功能的实现代码

[关闭]
~ ~