Home >Backend Development >PHP Tutorial >THINKPHP content pagination code sharing_PHP tutorial
This article mainly shares with you a piece of THINKPHP content paging code for your own use. It is extracted from my project. It is very easy to use. It is recommended here. To my friends.
In a content management system developed using Thinkphp, many things must be developed by yourself. Of course, content paging must also be developed by yourself. Here is the method I compiled based on the information:
1. First, you need to insert page breaks when editing content in the background. The page breaks of different editors are naturally different
2. Then when reading the article content, the content must be divided into multiple arrays according to the page breaks. However, here you need to pass the value of which page the current page is, and read the divided array according to the page number
The code is as follows:
The code is as follows:
Modify the configuration file 'News:article'=>array('{:module}/{:action}_{art_id}_{p}',0) and add a p parameter
The above is for reference only, and it needs to be adjusted according to your specific project. I believe that friends can expand it very well.