public function save() { $attributes = $this->getAttributes(); foreach ($attributes as $id => $value) { $this->saveItem($id, $value); } CacheUtility::createConfigCache(); }
public function actionDelete($id) { $model = $this->findModel($id); $model->delete(); $sql = SqlData::getDropFieldSql($model->table, $model->name_en); // LuLu::execute($sql); CacheUtility::createFieldCache(); return $this->redirect(['index', 'tb' => $model->table]); }
/** * Updates an existing ContentFlag model. * If update is successful, the browser will be redirected to the 'view' page. * * @param string $id * @return mixed */ public function actionUpdate($id) { $model = $this->findModel($id); if ($model->load(Yii::$app->request->post()) && $model->save()) { CacheUtility::createContentFlagCache(); return $this->redirect(['index']); } else { return $this->render('update', ['model' => $model]); } }
public function actionUpdate($id) { $model = $this->findModel($id); $pid = $model->parent_id; $catid = $model->category_id; if ($model->load(Yii::$app->request->post()) && $model->save()) { CacheUtility::createDictCache(); return $this->redirect(['index', 'pid' => $pid, 'catid' => $catid]); } else { $locals = []; $locals['model'] = $model; $locals['parent'] = $this->findModel($pid); $locals['parents'] = Dict::getParents($pid); $locals['category'] = DictCategory::findOne($catid); return $this->render('update', $locals); } }
public function actionDelete($tb) { $model = $this->findModel($tb); $model->delete(); DefineTableField::deleteAll(['table' => $tb]); $sql = SqlData::getDropTableSql($tb); LuLu::execute($sql); CacheUtility::createTableCache(); CacheUtility::createFieldCache(); return $this->redirect(['index']); }
public function actionDelete($id) { $this->findModel($id)->delete(); CacheUtility::createChannelCache(); return $this->redirect(['index']); }