/** * Creates a new model. * If creation is successful, the browser will be redirected to the 'view' page. */ public function actionCreate() { $model = new StudentPreviousDatas(); // Uncomment the following line if AJAX validation is needed // $this->performAjaxValidation($model); //print_r($_POST['StudentPreviousDatas']);exit; if (isset($_POST['StudentPreviousDatas'])) { //print_r($_POST); exit; $model->attributes = $_POST['StudentPreviousDatas']; if ($model->institution != NULL or $model->year != NULL or $model->course != NULL or $model->total_mark != NULL) { $model->save(); } //if($model->save()) $this->redirect(array('studentDocument/create', 'id' => $_REQUEST['id'])); } $this->render('create', array('model' => $model)); }