For help, thinkphp cannot import ("ORG. Util. Page"); paging files!

Source: Internet
Author: User
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 ");

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.