Follow my previous example. There's no need for you to add the validation on your controller when it can be done on the model side. A modeled piece of data can say when it is correctly modeled, or not. Decouple, baby.
-MI --------------------------------------------------------------------------- Remember, smart coders answer ten questions for every question they ask. So be smart, be cool, and share your knowledge. BAKE ON! blog: http://www.MarianoIglesias.com.ar -----Mensaje original----- De: [email protected] [mailto:[EMAIL PROTECTED] En nombre de GMail Enviado el: MiƩrcoles, 07 de Febrero de 2007 03:18 p.m. Para: [email protected] Asunto: R: How to validate a custom form? For example (If I have understood right) Define a dummy model And in your controller.... if($this->data['Custom']['email'] == '') { $this->set('emailError', 'Email required'); $this->Custom->invalidate('email'); } --~--~---------~--~----~------------~-------~--~----~ 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?hl=en -~----------~----~----~----~------~----~------~--~---
