On Tue, Apr 27, 2010 at 3:24 PM, John Andersen <j.andersen.lv@gmail.com> wrote:
As far as I can read from the api, then the validation expects a date
as a string, and you seems to pass it an array!
Please correct me if I am wrong :)
Enjoy,
John
> Check out the new CakePHP Questions sitehttp://cakeqs.organd help others with their CakePHP related questions.
On Apr 27, 8:29 am, Ed Propsner <crotchf...@gmail.com> wrote:
> I'm having a few problems trying to validate a date and I'm not sure what
> I'm doing wrong ...
>
> [date] => Array
> (
> [month] =>
> [day] =>
> [year] =>
> )
>
> I have the validation rule in the model set up close to the example
> in the book.
>
> 'dob' => array(
> 'rule' => 'date',
> 'message' => 'Some message here.',
> 'allowEmpty' => false
> )
>
> The book says if no keys are supplied the default key that will be
> used is 'ymd' ... that's fine.
>
> I'm not concerned about the format, I would just like to ensure the
> fields are not empty.
>
> When I submit the form it returns the following complaint:
>
> " preg_match() expects parameter 2 to be string, array given "
>
> What am I messing up this time ?
>
> - Ed
>
>
> 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+unsubscribe@googlegroups.com 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 cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://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 cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
No comments:
Post a Comment