Home  >  Article  >  php教程  >  tp3.2.1 post 分页实现

tp3.2.1 post 分页实现

WBOY
WBOYOriginal
2016-06-07 11:42:131445browse

post带参数的分页,实现方式
最近又在为tppost分页分心,不过这次却有重大发现,终于把post带参数分页功能实现了,如下:

post到index

function index($key=''){
//其他省略,只写关键的
if($mykey){
$where['title']=array('like','%'.trim($mykey).'%');
self::assign("mykey",$mykey);
}
...
$Page = new \Think\Page($count, $size=10); //count总数 $size每页显示数
$Page -> parameter['mykey']=$mykey;

parameter['mykey']=$mykey; >> 这句很关键,有多少个参数,就写多少个参数哦
}

AD:真正免费,域名+虚机+企业邮箱=0元

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:php图像裁剪Next article:Javascript播放器