Trouble passing multiple models into a view

Trying to use the ztabularinputmanager following the instructions here:

http://www.yiiframework.com/extension/ztabularinputmanager#add-comment

the actionCreate method of my mode is as below:




	public function actionCreate()

	{

		$model=new Event;

                $mediaManager = new eventMediaManager();


		// Uncomment the following line if AJAX validation is needed

		// $this->performAjaxValidation($model);


		if(isset($_POST['Event']))

		{

			$model->attributes=$_POST['Event'];

                        $mediaManager->manage($_POST['EventMedia']);

                        

                        if (!isset($_POST['noValidate'])){

                          $valid = $model->validate();

                          $valid = $mediaManager->validate($model) && $valid;

                        }

                        

                        if($valid){

                          $model->save();

                          $mediaManager->save($model);

                          $this->redirect(array('view','id'=>$model->id));

                        }

		}


		$this->render('create',array(

			'model'=>$model,

                        'mediaManager'=>$mediaManager,

		));

	}

but when I run the create action, the _form.php would load with an error saying Undefined variable: mediaManager whenever I used $mediaManager. Does anyone know why?

I used xDebug and verified that $mediaManager exists during the actionCreate, but it seems to disappeared in _form.php. I thought I passed it in. Did I do something wrong?

When you load your form partial, in your create view, do you pass the $mediaManager var ?

Ah… silly me… I kept thinking that passing it the actionCreate would do, played with it for nearly the whole day… sigh… Forgot that it gets to create.php first before it gets to _form.php. Thank you!