Because there are many pages in the site to use the paging function, so the paging program Ctrip function, when needed, can greatly reduce the workload of programming.
1. Design and implementation of paging function
The first thing the design function is to determine is the input and output of the function, and for the paging function,
Input parameters: 1) record the total number of result sets $RecordCount;
2) The number of records displayed per page $PageSize;
3) which page is currently displayed $page;
4) The URL of the current page;
5) Query the keyword $keyword.
As long as you set these 5 parameters in the program (if you don't have a query keyword and you don't set $keyword), you can invoke the paging function. The paging function has no return value, and its main function is to output a paging link.
Write a pager as a function