Ejemplo n.º 1
0
 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]);
 }
Ejemplo n.º 3
0
 /**
  * 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]);
     }
 }
Ejemplo n.º 4
0
 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);
     }
 }
Ejemplo n.º 5
0
 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']);
 }
Ejemplo n.º 6
0
 public function actionDelete($id)
 {
     $this->findModel($id)->delete();
     CacheUtility::createChannelCache();
     return $this->redirect(['index']);
 }