public function actionInsertar($eid) { //Genera un formulario para una funcion $retorno = Funciones::insertar($eid); if ($retorno) { // Si regresa un objeto $this->renderPartial('formulario', array('model' => $retorno)); } else { echo CJSON::encode($retorno); } }