Esempio n. 1
0
 /**
  * Deletes an existing FriendLink model.
  * If deletion is successful, the browser will be redirected to the 'index' page.
  * @param integer $id
  * @return mixed
  */
 public function actionDelete($id)
 {
     if (!$this->is_access('links/delete')) {
         Yii::$app->session->setFlash('error', $this->errorInfo);
         return $this->redirect($this->redirectUrl);
     }
     $model = $this->findModel($id);
     $model->delete();
     \backend\models\UserLog::addData('friend_link', $model->link_id, "删除友情链接[{$model->link_name}]", 'delete');
     return $this->redirect(['index']);
 }
Esempio n. 2
0
 /**
  * Deletes an existing Menu model.
  * If deletion is successful, the browser will be redirected to the 'index' page.
  * @param integer $id
  * @return mixed
  */
 public function actionDelete($id)
 {
     if (!$this->is_access('menu/delete')) {
         Yii::$app->session->setFlash('error', $this->errorInfo);
         return $this->redirect($this->redirectUrl);
     }
     $model = $this->findModel($id);
     $model->delete();
     \backend\models\UserLog::addData('menu', $id, "删除菜单[{$model->title}]", 'delete');
     return $this->redirect(['index']);
 }