Page number of thinkphp is not displayed (data is sufficient)

Source: Internet
Author: User
Thinkphp page number is not displayed (data is sufficient) 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 ();
}

The paging effect is available, but the page number is not displayed. the dump ($ show) data is empty. why?


Reply to discussion (solution)

What is the number of TP systems you use? If it is new, your import is invalid because the latest namespaces are used.

What is the number of TP systems you use? If it is new, your import is invalid because the latest namespaces are used.

I use 3.1, but fuzzy paging query can be implemented in another controller, and it won't work here

The other one can, but this cannot.
Apparently, you have something wrong! If the process is normal, the parameter is incorrect. Is the template correct?
Using the features provided by TP, you only need to follow the format, there is no place to debug (Dummies)

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

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

Oh, wrong variable. thank you.

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.