For help, thinkphp cannot import ("ORG.") Util.page "); Paging class file!

Source: Internet
Author: User
Public Function Issuspage ($MAP)
{
Import ("ORG. Util.page ");//Import page-out class
$count = M (' app_config ')->count ();//query satisfies the required total number of records
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);//Assignment Paging output

$this->assign ($_post);
$this->assign ("Data", $data);

$this->display (' AppConfig ');

}

The resulting results are:
-00--21
-0--
Why can't I get the $Page value? Everybody help, hurry Ah


\www\thinkphp\extend\library\org\util
There is a Page.class.php file in this location in the folder.


Reply to discussion (solution)

$Dao = M ("User");
Total calculation
$count = $Dao->count ();
Import page-Out class
Import ("ORG. Util.page ");



Instantiating a paging class
$p = new Page ($count, 10);
Pagination Display output
$page = $p->show ();

Current page data query
$list = $Dao->order (' id desc ')->limit ($p->firstrow. ', '. $p->listrows)->select ();

Assignment Value Assignment
$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.