[RFC] PEAR::Pager changes
| From: | Lorenzo Alberton | Date: | Wed, 09 Jul 2003 14:38:11 +0000 |
| Subject: | [RFC] PEAR::Pager changes | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-18100@lists.php.net to get a copy of this message | ||
Hi,
I've done a lot of work on the PEAR::Pager class,
and I'd like to collect some opinions before committing
them.
Basically, I've added all the options that were already
available in Pager_Sliding, for a complete customization.
My primary concern was BC, so I've kept everything as
it was before, even the default values for each option
are set to match the previous Pager version.
If you upgrade this class, without setting any new option,
you should notice no changes at all.
With these changes, Pager and Pager_Sliding are 100%
interchangeable, you can switch back and forth one
another just changing the included file and the class name.
Now you can use Pager with mod_rewrite, customize
every single appearance aspect you'd like to, there's
even an improved error handling that lets you specify
the PEAR_ERROR mode.
Technically, I could even write a common base class
as a wrapper for the two, and merge the two packages
in one, but I still haven't a strong opinion about that.
I'm here to listen to yours, anyway :-)
The *ONLY* BC change I had to introduce was in
getLinks() method.
WAS: getLinks($back_html='<< PREV', $next_html='NEXT >>';
NOW IS: getLinks($pageID=null, $back_html='', $next_html='');
i.e. the two parameters are shifted one position forward
to leave room for the new parameter. The two old
parameter are deprecated, BTW, since now you can
set them in the constructor, as common options.
(I removed the default values since they're already
set class-wide).
This change will affect only those who used this
method with values different from the default ones.
While externally everything is left as it was before,
the internals are quite different, so I won't provide
a diff since there are just too many changes.
Please refer to Pager_Sliding docs for more info:
http://pear.php.net/manual/en/package.html.pager-sliding.php
You can see the class source here:
http://cambiano.onlinein.it/pearzone/Pager.phps
or download it tar-gzipped (7kb) here:
http://cambiano.onlinein.it/pearzone/new_Pager.tar.gz
or zipped (7kb) here:
http://cambiano.onlinein.it/pearzone/new_Pager.zip
Best regards,
Lorenzo