i'm sorry for my perseverance but... the FormHelper magic is really limited just to one-level recursion?
On Sep 26, 8:52 pm, lorenx <[email protected]> wrote: > me again... > > i found the following link (i'm not using the $uses controller > attribute) and i did some tests:https://trac.cakephp.org/ticket/4626 > > so. > i built 3 models (TestGrandfather, TestFather and TestChild) and, > starting from the grandfather, tried to edit the 3-level dependecies: > in the edit method of the grandfather_controller: > $params = array( > 'conditions' => array('TestGrandfather.id' => $id), > 'contain' => array( > 'TestFather' => array( > 'TestChild' > ) > ) > ); > $this->data = $this->TestGrandfather->find('first', $params); > > in edit.ctp: > foreach ($form->data['TestFather'] as $key => $father): > echo $form->input('TestFather.'.$key.'.name'); > > foreach ($father['TestChild'] as $subkey => $child): > echo > $form->input('TestFather.'.$key.'.TestChild.'.$subkey.'.name'); > echo > $form->input('TestFather['.$key.'][TestChild]['.$subkey.'] > [name]'); > endforeach; > endforeach; > > but none of the two echos (those inside the secondo foreach) behaves > as expeted... > i'm stuck here... > > On Sep 26, 6:52 pm, lorenx <[email protected]> wrote: > > > > > sorry but... the FormHelper magic is limited just to one-level > > recursion? > > > On Sep 26, 12:34 pm, lorenx <[email protected]> wrote: > > > > hi all, again. > > > > i have a $form->data populated with models deeply related and i'm not > > > able to take full advantage of the formhelper magic. > > > > in the last part of the form i use foreach to cycle on the deep models > > > and i refer to them with: > > > 'ModelA.ModelB.'.$i.'.ModelC.0.field' > > > but nothing happens. > > > > i'd like to say that the array is correctly populated as shown by: > > > pr($form->data['ModelA']['ModelB'][$i]); > > > and, of course, by: > > > pr($form->data['ModelA']['ModelB'][$i]['ModelC'][0]['field']); > > > that displayes the right field value. > > > > besides, i even try to fill the field data on the fly by doing: > > > $form->data['ModelA']['ModelB'][$i]['ModelC'][0]['field'] = > > > 'my_value'; > > > but: > > > echo $form->input('ModelA.ModelB.'.$i.'.ModelC.0.field'); > > > still has no value. > > > > any ideas? > > > thank you very much! --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
