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 ();
?>