In order to add a new ShiftDetail to an existing Shift you would need
to display multiple ShiftDetail forms within the form using the naming
convention
$form->input('ShiftDetail.0.id');
$form->input('ShiftDetail.0.field1');
$form->input('ShiftDetail.0.field2');
$form->input('ShiftDetail.1.id');
$form->input('ShiftDetail.1.field1');
$form->input('ShiftDetail.1.field2');
$form->input('ShiftDetail.2.id');
$form->input('ShiftDetail.2.field1');
$form->input('ShiftDetail.2.field2');
If your data array contains an value for ShiftDetail.0.id, ShiftDetail.
1.id or ShiftDetail.2.id then they will be updated, if not they will
be created.
You're probably going to have to offer an 'New ShiftDetail' link
somewhere that sends an Ajax request to append a new ShiftDetail form
as and when a user needs to add another ShiftDetail ... but on editing
a Shift you just run through a loop showing a form for each existing
ShiftDetail record.
HTH
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---