Thursday, September 25, 2008

Re: Problem with form helper

Could you please post your controller code to populate the form?

grigri schrieb:
> I've never seen it done that way before. I always do it like this:
>
> (simplified view)
> $n = empty($this->data['Contact']) ? 0 : count($this-
>> data['Contact']);
> for ($i = 0; $i<$n; $i++) {
> echo $form->input("Contact.$i.name");
> }
>
> This way the data is like this:
>
> $data = array(
> 'Contact' => array(
> 0 => array('id' => ..., 'name' => ...),
> 1 => array('id' => ..., 'name' => ...),
> 2 => array('id' => ..., 'name' => ...),
> ...
> )
> );
>
> ...works fine.
>
> hth
> grigri
>
> On Sep 25, 3:53 pm, Günther Theilen <thei...@eqi.de> wrote:
>> Donkeybob schrieb:
>>
>>> what happens when you do it the other way . . .
>> That doesn't work at all.
>>
>> I think I'll just capitulate an do it the old fashioned way:
>> index.ctp to list the records, edit.ctp to edit _one_ record
>>
>> Thanks anyway!
>>
>> Regards
>> Guenther
> >


--~--~---------~--~----~------------~-------~--~----~
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: