Example #1
0
 public function actionMassdelete()
 {
     if (($ids = Yii::$app->request->post('selection')) !== null) {
         $models = $this->findModel(Yii::$app->request->post('selection'));
         foreach ($models as $model) {
             $model->delete();
         }
         $models = Profile::findAll(Yii::$app->request->post('selection'));
         foreach ($models as $model) {
             $model->delete();
         }
         $models = Auth::findAll(Yii::$app->request->post('selection'));
         foreach ($models as $model) {
             $model->delete();
         }
         return $this->redirect(['index']);
     } else {
         throw new HttpException(400);
     }
 }