jeremy is right @see http://www.dereuromark.de/2010/09/21/saving-model-data-and-security/ (The myth about “required” and “allowEmpty”) further down
i would - in your case - suggest to use "last"=>true as well! On 25 Sep., 14:25, Jeremy Burns | Class Outfit <[email protected]> wrote: > I'm prepared to be corrected, but my understanding is that 'required => true' > just means that the field must be present in the data array, and doesn't > really test its value. So in your case, required => true might be enough. > > Jeremy Burns > Class Outfit > > [email protected]http://www.classoutfit.com > > On 25 Sep 2010, at 12:20, Mariano C. wrote: > > > > > Reading the doc there's explained that require isn't a "pure" rule, so > > I'm asking how can I use it in multiple validation per field case: > > > example: > > var $validate = array > > ( > > 'id' => array( > > 'idRule-1' => array( > > 'rule' => 'isUnique', > > 'message' => 'id is already registered.' > > ), > > 'idRule-1' => array( > > 'rule' => > > '/^[a-z0-9]{3}-([a-z0-9]{5}-){3}[a-z0-9]{4}$/', > > 'message' => 'Id field is not valid.' > > ), > > > ) > > ) > > > How can I explain that ID field is required? where I can write this? > > > Second question: "allowEmpty => false" is stricter than "required => > > true"? My interpretation about allowEmpty => false is: field will be > > required and empty is not allowed. Am I right? If this, I could use > > allowEmpty in place of required. > > > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others > > with their CakePHP related questions. > > > 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 > > athttp://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. 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
