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?
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