Re: Validation class method (ssn)
| From: | Tomas V.V.Cox | Date: | Wed, 12 Jun 2002 13:55:42 +0000 |
| Subject: | Re: Validation class method (ssn) | ||
| References: | 1 2 3 4 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-6948@lists.php.net to get a copy of this message | ||
"Stig S. Bakken" wrote:
>
> On Fri, 2002-06-07 at 08:53, Tomas V.V.Cox wrote:
> > Tim Gallagher wrote:
> > >
> > > ssns are complex enough that perhaps we should extend the base validate
> > > class with a ssn class. plus this would allow easier segregation of code
> > > and minimize bloat in the core validate class.
> > > we could put it in an appropriate international folder under validate when
> > > installing too.
> > >
> >
> > Ok, I've opened the first "branch" for localizated validation routines
> > with the spanish one. Finally the i18n folder won't be used. Just create
> > a Validate/ISO.php file defining the class ValidateISO.
> >
> > Usage will be so:
> >
> > <?php
> > require_once 'Validate/US.php';
> > if (!ValidateUS::ssn($_POST['ssn'])) {
> > die("Bastard supply a correct SSN");
> > }
> > ?>
>
> Just a tiny little nit: the class name should be Validate_US. ;-)
>
Since some days Validate classes follow PEAR standars :-)
Tomas V.V.Cox