You either implement the loadInfo() method in your model so it returns
descriptions consistent with the fields you are using in your form.
Do pr($this->Model->loadInfo()); to get an idea of the format.
On Mar 9, 11:28 am, "jcsiegrist" <[EMAIL PROTECTED]> wrote:
> I'm trying to implement a simple form to be used for emailing. I'm
> using a model with var $useTable = false to take advantage of the
> validation features.
>
> Generally it works, the data is passing fine, but I get the php
> warning:
>
> Warning: array_combine() [function.array-combine]: Both parameters
> should have at least 1 element in /path/to/cake/libs/view/helpers/
> form.php on line 98
>
> Since the model has no db it does not return any metadata, just an
> empty array. So there should be a check for that in the formHelper
> around
>
> 95: if(isset($object)) {
> $fields = $object->loadInfo();
> $data = array(
> 'fields' =>
> array_combine($fields->extract('{n}.name'), $fields->extract('{n}.type')),
>
> 'key' => $object->primaryKey,
> 'validates' => (ife(empty($object->validate),
> array(),
> array_keys($object->validate)))
> );
> }
>
> Or am I missing something? I would not beginn to know how to properly
> patch it, so I'm hesitant to submit a ticket.
>
> Has anyone successfully used the new formHelpers create() method with
> models having no db?
>
> Thanks,
>
> :jc
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---