标签:style class blog code http ext
Volist标签主要用于在模板中循环输出数据集或者多维数组。
web页面代码
<!DOCTYPE html> <html> <head> <title></title> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <style type="text/css"> table,tr,td{border: 1px solid gray;text-align: center;} pre{font-size: 16px;} </style> </head> <body> <table> <tr> <td>ID</td> <td>姓名</td> <td>性别</td> </tr> <volist name="data" id="vo"> <tr> <td>{$vo.id}</td> <td>{$vo.user_name}</td> <td>{$vo.sex}</td> </tr> </volist> </table> </body> </html>
<?php class UserAction extends Action{ public function index(){ $m=M('User'); $arr=$m->select(); $this->assign('data',$arr); $this->display(); }
ThinkPHP官网对于volist的详细介绍http://doc.thinkphp.cn/manual/volist.html
ThinkPHP中volist标签的使用,布布扣,bubuko.com
标签:style class blog code http ext
原文地址:http://blog.csdn.net/szy361/article/details/30098051