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