Example #1
0
 public function actionCreateForStaff($id)
 {
     $model = new UserDate();
     $model->user_id = $id;
     $model->year = date('Y');
     if ($model->load(Yii::$app->request->post()) && $model->save()) {
         return $this->redirect(['userinfo/index']);
     } else {
         return $this->render('create', ['model' => $model]);
     }
 }