Home > php教程 > php手册 > body text

tp3.2.1 post 分页实现

WBOY
Release: 2016-06-07 11:42:13
Original
1462 people have browsed it

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元

source:php.cn
Statement of this Website
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
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!