Re: Validate: problems, suggestion, RFC
| From: | Pierre-Alain Joye | Date: | Mon, 17 Feb 2003 12:37:59 +0000 |
| Subject: | Re: Validate: problems, suggestion, RFC | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-13406@lists.php.net to get a copy of this message | ||
On Mon, 17 Feb 2003 13:28:33 +0100
Bertrand Mansion <bmansion@mamasam.com> wrote:
> Hi Pierre, Damien,
>
> I have made some CS changes to the Validate package as you might have
> noticed in CVS. Hope you didn't mind...
>
> After a few tests using Validate with QuickForm, I think it might be a
> good thing to split some method into smaller chunks. For instance, the
> Validate::number() could call two other methods:
> Validate::numberFormat() and Validate::numberMinMax(). This would give
> more control on the error and why the number didn't pass the test. In
> terms of feedback to the user, that's better.
Besides the fact that splitting the number method is not coherent, I do
not think that is a good idea, and so thought too the
original coauthors while we have created this package (tomas). The goals
is to tell if a data is valid, or not, the user interaction (comments,
explanation) is up to the developer if needed. Keeping in mind this
package is not only used as frontend validation (i.e. I use it for
"mass" validation of customa datas).
> I tested the ISBN validation but it didn't work with my entry :
> 0-7851-0853-X (a Richard Corben Marvel comics...)
> This entry works with http://www.isbn.nu so that might be a
> bug.
'ISBN0-7851-0853-X' is the right way to represent a isbn, afaik.
> Apart from these problems, everything else in
> Validate.php seems to work as expected with QuickForm.
nice to hear ;)
pierre