/** * Updates an existing ProductUnit model. * If update is successful, the browser will be redirected to the 'view' page. * @param integer $id * @return mixed */ public function actionUpdate($id) { $model = $this->findModel($id); if ($model->load(Yii::$app->request->post())) { Util::save($model); } $searchModel = new ProductUnitSearch(); $dataProvider = $searchModel->search(Yii::$app->request->queryParams); return $this->render('update', ['model' => $model, 'searchModel' => $searchModel, 'dataProvider' => $dataProvider]); }
/** * Updates an existing ProductCategory model. * If update is successful, the browser will be redirected to the 'view' page. * @param integer $id * @return mixed */ public function actionUpdate($id) { $model = $this->findModel($id); if ($model->load(Yii::$app->request->post())) { $model->last_update = date("Y-m-d H:i:s"); \app\components\Util::save($model); } $searchModel = new ProductCategorySearch(); $dataProvider = $searchModel->search(Yii::$app->request->queryParams); return $this->render('update', ['model' => $model, 'searchModel' => $searchModel, 'dataProvider' => $dataProvider]); }