TP framework issue. The second post will help you!

Source: Internet
Author: User
TP framework issue. The second post will help you! Why is the word "homepage" not displayed?
$ Counts = $ stars-> count ();

$ Page = new \ Think \ Page ($ counts, 10); // instantiate the paging class, the total number of incoming records and the number of records displayed on each Page (25)

$ Page-> lastSuffix = false; // The total number of pages not displayed on the last Page

$ Page-> setConfig ('header ','
  • % NOW_PAGE %/% TOTAL_PAGE % page
  • ');

    $ Page-> setConfig ('first ', 'homepage ');

    $ Page-> setConfig ('prev', 'Previous page ');

    $ Page-> setConfig ('next', 'next ');

    $ Page-> setConfig ('last', 'Last page ');

    $ Page-> setConfig ('theme ',' % FIRST % UP_PAGE % HEADER % DOWN_PAGE % END % ');

    $ Show = $ Page-> show (); // display the output by Page

    $ Data = $ stars-> order ('uptime asc ')-> limit ($ Page-> firstRow. ','. $ Page-> listRows)-> select (); // query paging data

    $ This-> assign ('page', $ show); // value-assigned paging output

    $ This-> assign ("photoshow", $ data );

    $ This-> display ("Index: twohundred ");
    }
    }


    Reply to discussion (solution)

    The template does not contain the first variable.

    What should I do if I want to get the result of the word "homepage ???

    But after page 7, the word "homepage" appears. why?

    $ Page-> show ();
    Go here to find the reason

    Brother, how can I find a solution? give me some suggestions!

    The TP framework has encountered a paging bug. just go in and track it and fix it.

    Code okay
    Reference: http://www.thinkphp1.cn/topic/29375.html

    But after page 7, the word "homepage" appears. why?



    The homepage appears on the page on which you can start with this parameter.

    Tp paging source code

    '% FIRST % UP_PAGE % HEADER % DOWN_PAGE % END %' add % LINK_PAGE %.

    Related Article

    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.