/** * Creates a new Driver model. * If creation is successful, the browser will be redirected to the 'view' page. * @return mixed */ public function actionCreate() { $model = new Driver(); if ($model->load(Yii::$app->request->post())) { $model->create_date = date("Y-m-d"); $model->d_update = date("Y-m-d H:i:s"); $model->save(); return $this->redirect(['view', 'id' => $model->id]); } else { $config = new \app\models\Config_system(); $driver_id = $config->autoId("driver", "driver_id", 5); return $this->render('create', ['model' => $model, 'driver_id' => $driver_id]); } }