Thats about the only way you can do it, especially if you need a restaurant ID before saving everything else. You should probably separate all those into separate model methods, and just call them like:
$this->Model->fooBar($restaurant_id, $data); However, all of those setFlash()'s are unneeded, especially since you can only display 1 flash at a time. On Sep 8, 11:08 am, hmvrulz <[email protected]> wrote: > i am using many models on the same controller. i have to save the data to the > db. > > this is the view. > > http://pastebin.com/mbbb68f > > as u can see am using many models like [B]Rating[/B], [B]Timing[/B] > [B]Review[/B] etc. This is just a small part of the form. > > In the controller i have added a add() method like this. which is kinda > crooked code :( is there a better way of saving these ? > > http://pastebin.com/d9d90df3 > -- > View this message in > context:http://www.nabble.com/Saving-data-when-many-models-are-in-use.-tp2535... > Sent from the CakePHP mailing list archive at Nabble.com. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
