Hi

I noticed a strange behaviour and wanted to know if it's there's a
order on executing validation rules

the example :

case 1 :
        var $validate = array(
                'word' => array(
                        array(
                                'required'      => true,
                                'allowEmpty'=> false,
                                'rule'          => '/\S+/',
                                'message'       => 'Required field.'
                        ),
                        array(
                                'rule'          => array('minLength', 3),
                                'message'       => '3 caracters min.'
                        ),
                )
        );

case 2 :
        var $validate = array(
                'word' => array(
                        array(
                                'rule'          => array('minLength', 3),
                                'message'       => '3 caracters min.'
                        ),
                        array(
                                'required'      => true,
                                'allowEmpty'=> false,
                                'rule'          => '/\S+/',
                                'message'       => 'Required field.'
                        ),
                )
        );

submitting an empty field will display '3 caracters min.' in case 1
and will display 'Required field.' in case 2...
for me it's a strange behaviour, I would think that rules are executed
in the order they are declared...

so how is determined the execution order ?

thanks in advance
--~--~---------~--~----~------------~-------~--~----~
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