> I agree with u monty
>
> i don't see why I should have to go and dig into the wiki to find such
> a thing
>
> why won't the hacky way become the right way ?

I do this using the beforeValidate method in the model, eg:

function beforeValidate()
{
        // check email is unique
        if ($this->findByEmail($this->data[$this->name]['email']))
        {
                $this->invalidate('email_unique');
        }
        return true;
}

this is less messy as it keeps all the validation in the same place,
and helps to keep your controller code tidy.

hth

jb


-- 


jon bennett
t: +44 (0) 1225 341 039 w: http://www.jben.net/
iChat (AIM): jbendotnet Skype: jon-bennett

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~----------~----~----~----~------~----~------~--~---

Reply via email to