求助TP3.2.3中分页的问题--页面不跳转

浏览:2492 发布日期:2016/07/11 分类:求助交流 关键字: thinkphp 分页
看到分页这块,利用Page类和limit方法.问题是:页面数据显示出来了,分页也显示出来了
但是当我单击第二页的时候,页面还是第一页,此时如下
此时URL确实变化了,但是并没有跳转。。。如果此时再继续点击第二页的话,会出现下面的情况
迷之尴尬。求助大神。小白初来乍到
竟然忘记贴代码了。。。
这是我的Index控制器里的book方法$book=D('book');
//        $r=$book->getByPage();
//        dump($r);
        // 1. 得到数据集的总数
        $count = $book->count();
        // 2. 创建分页类(Page)
        $page = new \Think\Page($count, 10);
        // 3. 获取分页码
        $show = $page->show();
        // 4. 获取分页记录
        $lists = $book->limit($page->firstRow . ',' . $page->listRows)->select();
        $this->assign('lists', $lists);
        $this->assign('pages', $show);
        // 显示视图
        $this->display('user');
这是显示的view{__NOLAYOUT__}
<table cellspacing="0" class="forumheaderlist">

  <!-- 表头信息 -->
  <tbody><tr>
    <!--<th class="header topic" scope="col">ID</th>-->
    <th class="header author" colspan="1">Bookid</th>
    <th class="header replies" scope="col">书名</th>
    <th class="header lastpost" scope="col">出版社</th>
  </tr>

  <foreach name="lists" item="vo">
    <tr class="">
      <!--<td class="topic starter" width="25%">{$vo.id}</a></td>-->
      <td class="replies" width="20%">{$vo.bookid}</td>
      <td class="lastpost" width="20%" style="text-align: center;">{$vo.bookname}</td>
      <td class="lastpost" width="20%" style="text-align: center;">{$vo.publisher}</td>
    </tr>
  </foreach>

  </tbody>
</table>
<div class="paging">
  {$pages}
</div>
最佳答案
评论( 相关
后面还有条评论,点击查看>>