correct. Let's say I wanted to add 3 accounts belonging to a company
using this form. Would this be the correct way to do so:
echo $form->create('Company', array('action'=>'add'));
echo $form->input('Company.name', array('label'=>'Company name'));
echo $form->input('Company.description');
echo $form->input('Company.location');
//Account #1
echo $form->input('Account.0.name', array('label'=>'Account #1
Name'));
echo $form->input('Account.0.username');
echo $form->input('Account.0.email');
//Account #2
echo $form->input('Account.1.name', array('label'=>'Account #2
Name'));
echo $form->input('Account.1.username');
echo $form->input('Account.1.email');
//Account #3
echo $form->input('Account.2.name', array('label'=>'Account #3
Name'));
echo $form->input('Account.2.username');
echo $form->input('Account.2.email');
echo $form->end('Add');
Thanks again for your help!
Charles
On Jul 22, 5:40 pm, Jens Dittrich <jdittr...@gmail.com> wrote:
> Because Company hasMany Account... the example implies that you want to save
> the first Account along with the new entry of a company.
--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.
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
No comments:
Post a Comment