public function actionShare($id) { $model = new AppUsers(); // Uncomment the following line if AJAX validation is needed // $this->performAjaxValidation($model); if (isset($_POST['AppUsers'])) { $model->attributes = $_POST['AppUsers']; //$model->setAttribute('id_users', Yii::app()->user->id); $model->setAttribute('id_app', $id); //salvando a relacao com a tabela Platforms if ($model->save()) { //$this->redirect(array('view','id'=>$model->id)); $this->redirect('/mtcontrool'); } } $this->render('share', array('model' => $model)); }