Thinkphp paging class instance that is similar to dedecms drop-down paging style modification

Source: Internet
Author: User
This article mainly introduces thinkphp paging class, which is similar to dedecms drop-down paging style modification. you can refer to ThinkPHP

This example describes the thinkphp paging class modified by the dede drop-down paging style. Share it with you for your reference. The specific implementation method is as follows:

Modify the thinkphp paging class: the following pull paging (similar to dedecms paging ):

Pure html code:

The code is as follows:

12

Modify Page operations:

Page. class. php Page, the relevant original code:

The code is as follows:

$ LinkPage = "";
For ($ I = 1; $ I <= $ this-> rollPage; $ I ++ ){
$ Page = ($ nowCoolPage-1) * $ this-> rollPage + $ I;
If ($ page! = $ This-> nowPage ){
If ($ page <= $ this-> totalPages ){
$ LinkPage. = "". $ page ."";
} Else {
Break;
}
} Else {
If ($ this-> totalPages! = 1 ){
$ LinkPage. = "". $ page ."";
}
}
}

After modification:

The code is as follows:

$ LinkPage ="";For ($ I = 1; $ I <= $ this-> rollPage; $ I ++ ){$ Page = ($ nowCoolPage-1) * $ this-> rollPage + $ I;If ($ page! = $ This-> nowPage ){If ($ page <= $ this-> totalPages ){$ LinkPage. ="". $ Page ."";} Else {Break;}} Else {If ($ this-> totalPages! = 1 ){$ LinkPage. ="". $ Page ."";}}}$ LinkPage. ="";

Shows the page effect:

I hope this article will help you with ThinkPHP programming.

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.