I have a form which collects a name, password and email_address which are all part of the User model. The same form also collects car_make which is part of the Car model. I know I can collect these as
$form->input("User.name"); or $form->input("Car.make");
and they are available in the action which the form submits to as
$this->data["User"] or $this->data["Car"]
But at this point I just want to save the User data and redirect to an action in the car controller which has the value they put in $form->input(“Car.make”); available.
How do I go about doing this?
are you sure you want to redirect to the cars controller? Or you just want to save that Car.make information?
If redirect,
$this->redirect(array('controller'=>'cars','action'=>'some_action','make'=>$this->data['Car']['make']));If save: loadModel(‘Car’) if Car is not related to User in anyway. Then save the data using that Car model object. Just something like
$this->User->Car->save($this->data);