public function actionBlokcreate() { $model = new Blok(); $this->layout = $this->CheckSession(); if ($model->load(Yii::$app->request->post()) && $model->save()) { //print_r($model->Blok_ID); //die; return $this->redirect(['warehouse/blokindex', 'id' => $model->Blok_ID]); } else { $id = $model->getLastIdBlok(); $model->Blok_ID = $id + 1; return $this->render('blok/create', ['model' => $model]); } }