public function actionDelete() { $id = Yii::$app->request->get('id'); if ($id > 0) { if (Warning::deletePicture($id)) { Warning::deleteAll(['id' => $id]); } } return $this->redirect(['index']); }