public function actionCreate() { $model = new Jobgrade(); /* if ($model->load(Yii::$app->request->post()) && $model->save()) { return $this->redirect(['view', 'ID' => $model->ID, 'JOBGRADE_ID' => $model->JOBGRADE_ID]); } else { return $this->render('create', [ 'model' => $model, ]); } */ if ($model->load(Yii::$app->request->post())) { $model->CREATED_BY = Yii::$app->user->identity->username; $model->UPDATED_TIME = date('Y-m-d h:i:s'); $model->save(); if ($model->save()) { //return $this->redirect(['view', 'id' => $model->ID]); return $this->redirect('index'); } } else { //return $this->render('_form', [ return $this->renderAjax('_form', ['model' => $model]); } }