Write a pager as a function

Source: Internet
Author: User

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

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.