/** * Creates a new ProductGroup model. * If creation is successful, the browser will be redirected to the 'view' page. * @return mixed */ public function actionCreate() { $model = new ProductGroup(); if ($model->load(Yii::$app->request->post()) && $model->save()) { return $this->redirect(['view', 'id' => $model->product_group_id]); } else { return $this->render('create', ['model' => $model]); } }
/** * Creates a new ProductGroup model. * If creation is successful, the browser will be redirected to the 'view' page. * @return mixed */ public function actionCreate() { $model = new ProductGroup(); if ($model->load(Yii::$app->request->post())) { $model->last_update = date("Y-m-d H:i:s"); $model->created_time = $model->last_update; \app\components\Util::save($model); } $searchModel = new ProductGroupSearch(); $dataProvider = $searchModel->search(Yii::$app->request->queryParams); return $this->render('create', ['model' => $model, 'searchModel' => $searchModel, 'dataProvider' => $dataProvider]); }