Send var to view

Hi, i’m trying to send one var to my render

$model=new Usuario;

		$groups=new CActiveDataProvider('Grupo');

		// Uncomment the following line if AJAX validation is needed

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




			$validation = $this->performAjaxValidation($model);

			$isValid = $this->isValid($validation);

			if(!$isValid){echo $validation; exit();}





				else echo('{"saved": "1", "message": "Saved with success"}');


			else echo('{"saved": "0", "message": "Not saved"}');	









			else {	







As you can see i;m sending the groups.

BUT, when i try to do a var_dump on the other side i receive one error.

If i do the vardump with the new CActiveDataProvider(‘Grupo’) its ok… how i can send the var?

Can you paste the error you have?


PHP Error [8]

Undefined variable: groups (/Developer/php/MonitorSVN/protected/views/usuario/_form.php:65)

In the code above you are rendering the "create" view… but the error happens in the "_form" view…

are you sending the variable $groups from the "create" view to the "_form" view ?

How i can do that?

Just check the content of the view "create" you will see there the renderpartial…

In create view you should have something like:

<?php echo $this->renderPartial('_form', array('model'=>$model, 'groups'=>$groups)); ?>