This article focuses on "using templates", but this method is suitable for any scenario and is a good solution when using templates, this problem occurs: the operation is troublesome when the paging information is displayed. n templates have paging blocks.
For example:
--- A total of 20 records. GO -----
When I first encountered this problem, it seemed that I was playing the php idea to solve it. how can I use php to implement it, however, no matter how you design it, design it into two solutions.
1. implement with nested loops
2. using n multiple judgments
But in the end, it is quite troublesome, and the server-side resources are used for parsing.
Use javascript to replace your php !!!!, In this way, you can reduce the amount of php script code and hand over the paging parsing work to the client. However, javascript debugging may be troublesome.
The most important thing is to simplify the difficulties encountered by parsing templates during paging display.
The following is a template that supports parsing by pear itx template tool.
Where And Indicates a block. a string similar to {recordcount} is a variable.
---------------- List. tpl ---------------------
The code is as follows:
// Other html code