Pear: integrated application of Pager and AJAX

Source: Internet
Author: User
Pear: integrated application of Pager and AJAX. Read the integrated application of Pear: 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 some class libraries of Ajax applications. However, Pager is not only applicable to html"

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_once 'pager/Pager. php ';
$ Data = range (1,100); // an array of data to paginate
$ Pager_params = array (
'Mode' => 'sliding ',
'Append '=> false, // don't 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.