About the use of $parameter in the paging function of thinkphp3.2.3
仅有的幸福
仅有的幸福 2017-05-16 13:09:35
0
3
419

I would like to ask those who know thinkphp, the paging function provided in the thinkphp3.2.3 document is as follows:
$User = M('User'); // Instantiate the User object
$count = $User->where('status=1')->count(); // Query the total number of records that meet the requirements
$Page = new ThinkPage($count,25); //Instantiate the paging class and pass in the total number of records and the number of records displayed on each page (25)
$show = $Page->show(); // Paging display output
// Perform paging data query Note that the parameters of the limit method must use the attributes of the Page class
$list = $User->where('status=1')->order('create_time')->limit($Page->firstRow.','.$Page->listRows)->select( );
$this->assign('list',$list); // Assign data set
$this->assign('page',$show); // Assign paging output
$this->display(); // Output template

I would like to ask, when I click on the next page, I can see that the value of p/2 is passed in the URL, but there is no relevant variable in this paging function to receive the value of p. Why is the function on the next page still valid?

仅有的幸福
仅有的幸福

reply all(3)
巴扎黑

page.class.php in thinkphp core framework
url https://github.com/top-think/...
Line 22 That’s it

某草草

. . You need to chase this paging class. Page numbers should be handled in the paging class

刘奇

This parameter is taken from the class you called

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template