예제 #1
0
 /**
  * Delete multiple attributes.
  *
  * @param string $id List of attribute ids like '1,2,3'
  *
  * @return \yii\web\Response
  * @throws NotFoundHttpException
  */
 public function actionDeleteMultiple($id)
 {
     $deleted = Attributes::deleteAll(['id' => explode(',', $id)]);
     if (!$deleted) {
         throw new NotFoundHttpException(Yii::t('main', 'The requested page does not exist.'));
     } else {
         Yii::$app->getSession()->setFlash('success', Yii::t('main', 'Deleted {count, plural, =0{no items} =1{1 item} other{# items}}', ['count' => $deleted]));
         return $this->redirect(Yii::$app->request->getReferrer());
     }
 }