Hi everybody,
first of all thank you for the really good work you've doing on cake.
I've used it 2 years ago for a massive application and I had to write
my own postgresql layer... The work done since then especially on 1.2
is amazing.
Anyway. I am trying to use multiple validation rules (1.2) with
allowEmpty and required but I just can't get it working.
I've look at the sources and it looks like the 2 keys must be included
in their own rule declaration ie:
'password' => array(
'notNull' =>array(
'allowEmpty' => false,
'required' => true,
'message' => 'Please enter a password.'
),
'between' => array(
'rule' => array('between', 4, 12),
'message' => 'Please check the number of
characters in your
password.'
).....
But that does not work because model will default the keywords value
for 'rule' to 'blank' !!! So what value should I give to 'rule'.
If I put allowEmpty and required outside a rule declaration it breaks
completely ie:
'password' => array(
'allowEmpty' => false,
'required' => true,
'message' => 'Please enter a password.',
'between' => array(
'rule' => array('between', 4, 12),
'message' => 'Please check the number of
characters in your
password.'
).....
so I am a bit stuck.
I guess I could use a custom rule which always return true and let
required and allowEmpty to invalidate if needed but surely there is a
better way ?
Thanks in advance.
Benjamin
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---