On the User model class add a function like: function validateFields($fields) { $ignore = array_diff(array_keys($this->validate), $fields); foreach($ignore as $field) { unset($this->validate[$field]); } }
You could also instead move this function to AppModel so you can have it available for other models. Then on your controller: $this->User->validateFields(array('user', 'password')); if ($this->User->set($this->data) && $this->User->validates()) { // Check login } -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: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] En nombre de cecplex Enviado el: Martes, 06 de Marzo de 2007 08:15 p.m. Para: Cake PHP Asunto: Re: Different Validations on 1 Table (Model) Based on the Action What if I have 15 fields and I only want 2 of them validated. Is there no construct available to let me validate a specific set of fields? --~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---