For help, thinkphp cannot import (ORG. Util. Page); paging files! Public function issusPage ($ map)
{
Import ("ORG. Util. Page"); // import the paging class
$ Count = M ('app _ config')-> count (); // query the total number of records meeting the requirements
Echo "-00 --". $ count;
$ Page = new Page ($ count, 10 );
Echo "-0 --". $ Page;
$ Data = M ('app _ config')-> where ($ map)-> limit ($ Page-> firstRow. ','. $ Page-> listRows)-> select ();
// $ This-> assign ('page', $ show); // value-assigned paging output
$ This-> assign ($ _ POST );
$ This-> assign ("data", $ data );
$ This-> display ('appconfig ');
}
The result is:
-00--21
-0 --
Why can't we get the value of $ Page? You can help us in a hurry ·····
\ Www \ ThinkPHP \ Extend \ Library \ ORG \ Util
In this folder, the Page. class. php file exists ····
Reply to discussion (solution)
$ Dao = M ("User ");
// Calculate the total number
$ Count = $ Dao-> count ();
// Import the paging class
Import ("ORG. Util. Page ");
// Instantiate the paging class
$ P = new Page ($ count, 10 );
// Display output by page
$ Page = $ p-> show ();
// Query the current page number
$ List = $ Dao-> order ('Id desc')-> limit ($ p-> firstRow. ','. $ p-> listRows)-> select ();
// Assign values
$ This-> assign ('page', $ page );
$ This-> assign ('data', $ list );
$ This-> display ("index ");