thinkphp Pagination page number is not displayed (data is sufficient)

Source: Internet
Author: User
Public Function trends () {

$showtrends = M (' Trends ');

Import (' ORG. Util.page ');

$showscount = $showtrends->count ();

$Page = new Page ($trendscount, 3);


$show = $Page->show ();

$list = $showtrends->limit ($Page->firstrow. ', '. $Page->listrows)->select ();

$this->assign (' Trends ', $list);

$this->assign (' page ', $show);

Dump ($show);
Exit ();

$this->display ();
}

Pagination effect can come out, but pagination page number does not show, dump ($show) data is empty, what's going on?


Reply to discussion (solution)

What time do you use the TP system? If it is new then your import is invalid, because the newest one uses the namespace.

What time do you use the TP system? If it is new then your import is invalid, because the newest one uses the namespace.

I use 3.1 of, but in the other controller can achieve fuzzy paging query, here is not

The other one can, but it can't be.
Obviously you have something wrong! If there is no problem with the process, the parameters are incorrect. What's more, is the template
Use TP to provide the function, just press his format to go, there is nothing to debug the place (Fool way)

Take this $Page = new Page ($trendscount, 3);
Change to $Page = new Page ($showscount, 3);

Take this $Page = new Page ($trendscount, 3);
Change to $Page = new Page ($showscount, 3);

Oh, yes, the variables are wrong, thanks, huh?
  • 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.