先上效果图,突然发现和B站上一样
IndexController.class.php代码如下
public function index(){ $m=M('Info'); $count = $m->where($where)->count(); $pageCount = 10;//每页显示数量 $page = new \Think\Page($count , $pageCount); $page->parameter = $row; //此处的row是数组,为了传递查询条件 $page->setConfig('header','条留言'); $page->setConfig('first','首页'); $page->setConfig('prev','上一页'); $page->setConfig('next','下一页'); $page->setConfig('last','尾页'); $page->setConfig('theme','%FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END%<div id="pageTips">第 '.I('p',1).' 页/共 %TOTAL_PAGE% 页 ( '.$pageCount.' 条/页 共 %TOTAL_ROW% 条信息)</div>'); $show = $page->show(); $list = $m->where($where)->order('id desc')->limit($page->firstRow.','.$page->listRows)->select(); $this->assign('infoList',$list); $this->assign('show',$show); $this->display(); }
index.html代码如下
<table class="table table-hover table-striped" id="table"> <tr class="danger"> <th>类别</th> <th>信息标题</th> <th>物品类型</th> <th>遗失/拾物时间</th> <th>遗失/拾物地点</th> <th >发布时间</th> </tr> <foreach name="infoList" item='vo'> <tr > <td>{$vo.info_type}</td> <td>{$vo.info_title}</td> <td>{$vo.thing_type}</td> <td>{$vo.info_time}</td> <td>{$vo.info_place}</td> <td>{$vo.create_time}</td> </tr> </foreach> </table> <div class="page"> <ul> {$show} </ul> </div>
css代码如下
/* start 分页样式 */ .page{ overflow:hidden; margin:50px 0 50px 100px;; } .page ul a,.page ul span{ float:left; display:inline-block; padding: 0 17px; height:40px; width:auto; border:1px solid #DDDDDD; border-radius: 4px; background:#fff; text-align:center; line-height:40px; margin-right:10px; font-family: "microsoft yahei" simhei sans-serif; color:#7d7d7d; } .page ul a:hover{ background:#337AB7; color:#fff; text-decoration:none; } .page ul span.current{ background: #337AB7; color:#fff; } .page ul a:first,.page ul a:last{ float:left; display:inline-block; width:40px; height:40px; border-radius:50%; background:rgb(215, 215, 217); text-align:center; line-height:40px; margin-right:10px; font-family: "microsoft yahei" simhei sans-serif; } #pageTips { float:right; } /* end 分页样式 */
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持。
华山资源网 Design By www.eoogi.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
华山资源网 Design By www.eoogi.com
暂无评论...
更新日志
2024年09月23日
2024年09月23日
- Merryland《Merryland》[320K/MP3][69.48MB]
- 苏芮.1991-停在我心里的温柔【福茂】【WAV+CUE】
- 苏慧伦.2020-面面Every.Side.of.Me【相信音乐】【WAV+CUE】
- 群星.1991-不一样的感觉REMIX【宝丽金】【WAV+CUE】
- 银霞.1983-《你那好冷的小手》珍藏纪念版[WAV分轨]
- 银霞.2002-《国语巨星专辑VOL.3》2CD台湾版[WAV+CUE]
- 金池刘罡《昨日情歌HQ》头版限量编号[低速原抓WAV+CUE]
- 段奥娟.2024-23·岁碎念【白米范】【FLAC分轨】
- 顺子.2001-昨日·唯一·更多·顺子自选辑【魔岩】【WAV+CUE】
- 无印良品.1999-私藏三首·原创相对论(EP)【滚石】【WAV+CUE】
- Merryland《Merryland》[FLAC/分轨][170.22MB]
- 庄锭欣 ELKIE《没有你的未来》[320K/MP3][15.78MB]
- 庄锭欣 ELKIE《没有你的未来》[FLAC/分轨][36MB]
- TchaikovskySwanLake,Op.20柴可夫斯基天鹅湖(2013)SACD[Hi-Res]
- 24bit达人艺典《琴歌终极版》整轨WAV+CUE