public function actionGudangcreate() { $model = new Gudang(); $this->layout = $this->CheckSession(); if ($model->load(Yii::$app->request->post()) && $model->save()) { return $this->redirect(['warehouse/gudangindex', 'id' => $model->Gudang_ID]); } else { $id = $model->getLastIdGudang(); $model->Gudang_ID = $id + 1; return $this->render('gudang/create', ['model' => $model]); } }