Blogger Information
Blog 55
fans 0
comment 0
visits 58856
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
分页后保持条件
南鸢离梦的博客
Original
754 people have browsed it
  1. 在这里记录一下Tp5保持分页状态的两种方法:
  2. 一:
  3. Db::name('data') -> where($where) -> paginate(5,false,['query' => request()->param()]);
  4. 二:
  5. $params = $this -> request -> param();
  6. $users = Db::name('data')->where($where)->paginate(15);
  7. // 在 render 前,使用appends方法保持分页条件
  8. $users->appends($params);
  9. $this->assign('page', $users->render());//单独提取分页出来
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post