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.