Pear: integration of Pager and AJAX-PHP Tutorial-php Tutorial

Source: Internet
Author: User
Pear: integrated application of Pager and AJAX. As a PHP developer, one of the most useful things is the Pear class library. We know that Pear: Pager is dedicated to processing pages, while Pear: HTML_AJAX is an Ajax application.

As a PHP developer, one of the most useful things is the Pear class library. We know that Pear: Pager is dedicated to processing pages, while Pear: HTML_AJAX is some class libraries of Ajax applications. However, Pager is not only used for html paging links. it is ready for Ajax, which is more popular than the Supergirl. let's take a look at how these two packages integrate the application.

Pager and Javascript
Now, the first step is to build a javascript link and integrate it with Ajax. In theory, it should also be implemented. The following is an example of Pager and javascript paging:

PLAIN TEXT
PHP:
Require_oncePager/Pager. php;
$ Data = range (1,100); // an array of data to paginate
$ Pager_params = array (
Mode => Sliding,
Append => false, // dont append the GET parameters to the url
Path =>,
FileName => javascript: revealDiv (% d), // Pager replaces "% d" with the page number...
PerPage => 10, // show 10 items per page
Delta => 5,
ItemData => $ data,
);
$ Pager = & Pager: factory ($ pager_params );
$ N_pages = $ pager-> numPages ();
$ Links = $ pager-> getLinks ();
?>


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.