Sure thing; at a low level, it might be used as follows:

require_once 'Zend/Validate/EmailAddress.php';
$validator = new Zend_Validate_EmailAddress($someOption, $anotherOption);
if ($validator->isValid($someEmail)) {
    // valid...
} else {
    // invalid...
    foreach ($validator->getMessages() as $message) {
        echo "$message\n";
    }
}

Best regards,
Darby

Simon R Jones wrote:
>> First, any validator is its own class under the new design, 
>> rather than being a single method of a larger scope, 
>> general-purpose validation class (as in the implementation 
>> currently in the framework core trunk).
> 
> Darby - do you have any information about how this new encapsulation works
> since I've not seen it before, and how Zend_Validate_EmailAddress would be
> called from a calling script? I can then fill up some of the blanks in the
> class skeleton you've provided.
> 
> best wishes,
> Simon
> 
> 

Reply via email to