/* Tables /*
users people contacts
---------- 1<--->1 -------- n<--->n ----------
id id id
username user_id phone
f_name
Yes, there is a people_contacts table with both Ids
/* View */
<?php
echo $this->Form->create('User');
echo $this->Form->input('username');
echo $this->Form->input('Person.f_name');
echo $this->Form->input('Contact.0.phone');
echo $this->Form->end(__('Submit', true));
?>
/* Controller */
function register($step = "create_account") {
if (!empty($this->data)) {
$this->User->create();
if ($this->User->saveAll($this->data)) {
$this->Session->setFlash(__('The user has been saved', true));
} else {
$this->Session->setFlash(__('The user could not be saved.', true));
}
}
}
On Tue, Nov 2, 2010 at 22:15, Fernando Barrocal <fbarrocal@gmail.com> wrote:
Hi guys,I am having some trouble with pretty basic things but it took me precious hours today, and I decided to ask for some light ...I have this config that I am trying to make work:I baked everything with cake bake and I need a way to proper save all 3 models on submitAny hints or ideas ?
--
Fernando Barrocal <fbarrocal@gmail.com>
+55 11 8257-7200
+55 11 3020-7332
skype: fbarrocal
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:
Post a Comment