I want to edit multiple records in one view.

Controller:

$this->data = $this->Contact->find('all', array(
   'conditions' => array(
     'Contact.user_id' => $this->Session->read('Auth.User.id')
));


View (simplified):

for ($i = 0; $i < count($this->data); $i++):
e($form->input("$i.Contact.name");


Which works perfectly for the second, third,... records but not for the 
first which has the array key 0.


Donkeybob schrieb:
> Why would you be using an array integer instead of the model name?
> Does this not use a model? Code you post you controller code that
> populates this form?
> 
> On Sep 25, 8:54 am, Günther Theilen <[EMAIL PROTECTED]> wrote:
>> Hi!
>>
>> I've got a weird problem with the form helper, maybe someone can help...
>>
>> $form->input("5.name") creates an input field with name="data[5][name]",
>> which is pretty much what I expected.
>>
>> But $form->input("0.name") creates an input field with
>> name="data[foo][name]", foo is the pluralized modelname.
>>
>> Why?
>> And how can I create an input field with name="data[0][name]"?
>> (Except for creating it manually of course... ;-))
>> (Cake 1.2.0.7296 RC2)
>>
>> 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to