var $validate = array(
                        'username' => array(
                                'customFunction' => array('rule'=> 
'customFunction',
'message'=>'user name error', ),
                                ),
);

function customFunction($data) {

   if($data['username'] == $someConditions) {
        return true;
   }
  else if ($data['username'] == $someOtherConditions) {

         return false;
  }
  //otherwise failed
   return false;
}

instead of return false can i return the specific reason why it failed
in the form of an error message?

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to