Example #1
0
 public function actionCreate()
 {
     $model = new Corp();
     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->renderAjax('_form', ['model' => $model]);
     }
 }