I have a form that have fields from another model. some of them are many-to-many and some one-to-one Problem is when I try to edit the form I only can pass 1 object like

$this->view->form = new CourseForm($course, array( 'edit' => true ));

Here i also want to pass $course->location because location is a different model and relationship is one 2 one. when I pass

$this->view->form = new CourseForm($course->location, array( 'edit' => true ));

Only location shows up in view.

So is there any way to pass multiple objects in Form. I don't want to create a new form for each model.

So in a nutshell how can I do this

$this->view->form = new CourseForm($course + $course->location, array( 'edit' => true ));