Re: Proof of concept: Custom validation using beforeValidate

2006-06-13 Thread gwoo
you can do most of this without any other helpers or changes to the core code. function beforeValidate() { $this-invalidate('username_taken'); return false ; } the in your view $html-tagErrorMsg('User/username_taken', 'This username is already taken. Please choose another');

RE: Proof of concept: Custom validation using beforeValidate

2006-06-13 Thread Ryan Ginstrom
[mailto:[EMAIL PROTECTED] On Behalf Of RosSoft invalidate() sets a row in an array with a value of 1. Change invalidate() to set the string as value (then the errors will be available in your controller and helpers) Nice. So I could override invalidate in app_model: /* +++ */ function

RE: Proof of concept: Custom validation using beforeValidate

2006-06-13 Thread Ryan Ginstrom
[mailto:[EMAIL PROTECTED] On Behalf Of gwoo you can do most of this without any other helpers or changes to the core code. function beforeValidate() { $this-invalidate('username_taken'); return false ; } the in your view $html-tagErrorMsg('User/username_taken', 'This

Re: Proof of concept: Custom validation using beforeValidate

2006-06-13 Thread gwoo
I prefer to have my messages in the view. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to

Proof of concept: Custom validation using beforeValidate

2006-06-12 Thread ginstrom
I really like the idea of custom validation error messages. For example, for a password field you could check that the password was entered the same way twice, contains at least two numbers, no illegal characters, etc., and give a different error message for each. I think that validation should