-- Bart McLeod <[EMAIL PROTECTED]> wrote
(on Thursday, 10 April 2008, 04:05 PM +0200):
> I'm probably the laziest of you all when it comes to solving this 'problem':
>
>    class FrontendEmailValidator extends  Zend_Validate_EmailAddress {
>        public function getMessages() {
>            return array("This is not a valid e-mail address.");
>        }
>    }
>
> Seems like not to much code to me.

Seems like a great way to use OOP, if you ask me.

You heard of Larry Wall, author of Perl? One of the virtues of a
programmer he espouses is "laziness" -- what you show above is a great
exemplar of that virtue, to my thinking. :-)

> Rob Allen schreef:
> >
> > On 6 Apr 2008, at 15:54, dowker wrote:
> > >
> > > Thanks Rob. As in my example above, wouldn't you see the same error  
> > > message
> > > '[EMAIL PROTECTED] is not a valid email address' 4 times?
> > >
> >
> > Hi dowker,
> >
> > Looking again, at the extended class we use, I see that I also  
> > extended isValid so that there's only ever one error returned.


-- 
Matthew Weier O'Phinney
Software Architect       | [EMAIL PROTECTED]
Zend - The PHP Company   | http://www.zend.com/

Reply via email to