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);
if(isset($_POST['Usuario']))
{
$model->attributes=$_POST['Usuario'];
$validation = $this->performAjaxValidation($model);
$isValid = $this->isValid($validation);
if(!$isValid){echo $validation; exit();}
if($model->save()){
if(!isset($_POST["ajax"])){
$this->redirect(array('view','id'=>$model->id));
}
else echo('{"saved": "1", "message": "Saved with success"}');
}
else echo('{"saved": "0", "message": "Not saved"}');
}
else{
if(isset($_POST)){
$this->renderPartial('create',array(
'model'=>$model,
'groups'=>$groups
));
}
else {
$this->render('create',array(
'model'=>$model,
'groups'=>$groups
));
}
}
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?