Login   Register  
PHP Classes
elePHPant
Icontem

File: index.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Eugene Panin  >  Pager  >  index.php  >  Download  
File: index.php
Role: ???
Content type: text/plain
Description: Usage example
Class: Pager
Author: By
Last change:
Date: 2000-10-24 08:51
Size: 596 bytes
 

Contents

Class file image Download
<html>
<body bgcolor=white>
<h2>Example of Pager object.</h2>
<p>
<p>
<?
require "Pager.php";
require "Page.php";

# setting up target array
$ar=array();
for ($i=0;$i<123;$i++) {
    $ar[]=$i;
}

$elems_per_page = 12;
$pager = new Pager($ar,$elems_per_page);

# $pageno - input parameter
if (empty($pageno)) {
        $pageno = 1;
}

#printing page nummbers
$pager->printPageNumbers($pageno,'series');

echo "<p>";
# printing page result
$page = $pager->page($pageno);
while (list($key,$val)=each($page->result)) {
        echo "$val<br>";
}

?>
</body>
</html>