I have currently have this problem of a validating a field where there
is an "override" which will change the validation criteria. I've got a
working solution so far, but the message remains the same, which sort
of gives the wrong impression.

This would be cool:

function customValidationFunc( $data ) {
    if( [some critera] ) return true;

    // failed criteria, so issue warning
    if( !$this->data['Tbl']['override'] ) {
         $message = "Warning: Field failing";
         // [assign message somehow]
         return false;
    }

     // issued override

     // check some other criteria
     if( [some other criteria] ) return true;

     // still failing, this is an error now
     $message = "Error: Field still failing";
     // [assign message somehow]
     return false;
}

Is this possible?

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to