controllers/NotificationsController.php
public function actionDeleteAll()
    {
        $notificationsIds = Yii::$app->request->post('ids', []);

        foreach ($notificationsIds as $id) {
            $notification = $this->getNotification($id);

            $notification->delete();
        }

        return true;
    }
public function actionDeleteAll()
    {
        $notificationsIds = Yii::$app->request->post('ids', []);

        foreach ($notificationsIds as $id) {
            $notification = $this->getNotification($id);

            $notification->delete();
        }

        return true;
    }
public function actionDeleteAll ( ) { $ notificationsIds = Yii :: $ app -> request -> post ( 'ids' , [ ] ) ; foreach ( $ notificationsIds as $ id ) { $ notification = $ this -> getNotification ( $ id ) ; $ notification -> delete ( ) ; } return true ; }
Delete all notifications

@throws HttpException Throws an exception if the notification is not
found, or if it don't belongs to the logged in user
Delete all notifications