Saturday, September 26, 2009

formhelper: deep model values

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