Exemplo n.º 1
0
 public function actionOfficecreate()
 {
     $model = new MOffice();
     if (Yii::$app->request->isPost) {
         $model->load(Yii::$app->request->post());
         $model->gh_id = Yii::$app->user->getGhid();
         if ($model->save()) {
             return $this->redirect(['officelist']);
         } else {
             U::W($model->getErrors());
         }
     }
     return $this->render('officecreateupdate', ['model' => $model]);
 }