If you are going to load a lot of models into one I WOULD NOT RECOMMEND THIS! You should use database relations to navigate, ie. $this->User->Post->find(); or Use containable as well. Or use $this- >loadModel when you need it. Putting a lot of models into the uses variable slows your sites speed down a ridiculous amount.
On Jul 13, 1:20 pm, Vijay Kumbhar <k.vidn...@gmail.com> wrote: > Hello Sheetal, > > You are right about using the $uses. You have to use that as follows, > > var $uses = array('Main model name' , '2nd model name' .......so on); > > in the add function you have to write, > > $this->modelname->tablefieldname = > $this->data['modelname']['form_field_name']; //here $this->data['modelname'] > is the array coming from the form from where you are taking the data. > > $this->modelname->create(); > $this->modelname->save(); > > Use the above procedure for all the models you want to use insert the data > in that tables. > > May be this will help you to solve your problem. > > > > On Tue, Jul 14, 2009 at 1:13 AM, Sheetal <radha...@gmail.com> wrote: > > > Hi Friends > > My scenario is : > > I have a single controller file, lets keep its name as > > conditions_controller.php. > > This controller file saves the details that are submitted from a form. > > But the form details needs to be saved in 3 different table. > > The thing here is I am saving it in 3 different tables. But when it > > comes to validation it becomes a problem for me. > > > Lets keep in the form i have 6 fields. > > The validation of first 2 fields is done in condition.php (primary > > model) > > The validation of second 2 fields is done in condition_two.php > > (different model file becoz it is for a diff. table) > > The validation of third 2 fields is done in condition_three.php > > ( different model file becoz it is for a diff. table) > > > The validation for first 2 fields happen, msg. gets displayed if user > > does not fill in the form. But for the other two tables, the > > validation messages do not get displayed. Though the fields are set as > > mandatory, even when user submits a form without entering those fields > > the form is getting submitted. > > > Now I want to display the validation msgs. from the other 2 model > > files too... > > How to achieve this? > > I read something abt $uses array... but I don't understand as to how > > to put it to my use? > > Please help me in solving this problem. > > > Thanks in advance. > > -- > Thanks & Regards, > Vijayk. > Co-founder (www.weboniselab.com) > > "You Bring the Dreams, We'll Bring the Means" --~--~---------~--~----~------------~-------~--~----~ 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---