Pager - return array rather than HTML..
| From: | Alan Knowles | Date: | Thu, 27 Jun 2002 12:43:10 +0000 |
| Subject: | Pager - return array rather than HTML.. | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-7388@lists.php.net to get a copy of this message | ||
Attached (hopefully) is a patch to return an array rather than HTML. I
need the 'calculations' of pager, but not the HTML output.
It allows you to start it up something like this.
$pager = new Pager(array(
'totalItems' => $N,
'perPage' => $options['perPage'],
'returnType' => 'RAW',
'currentPage' => $currentPage
));
list($number_start, $array, $number_end) = $pager->getLinks();
where $array is
[1] => 0
[2] => 1
[3] => 0
[4] => 0
there is also a small change to urlencode the querystring - which may
not be neccesary......
regards
alan