diff --git a/backend/controllers/BookController.php b/backend/controllers/BookController.php index 21da149..c136e04 100644 --- a/backend/controllers/BookController.php +++ b/backend/controllers/BookController.php @@ -143,6 +143,20 @@ return $this->redirect([ 'index' ]); } + public function deleteModel($id) + { + $book = Book::find() + ->where( + [ + 'id' => $id, + ] + ) + ->one(); + + + return $book->delete(); + } + public static function removeDirectory($dir) { if ($objs = glob($dir . "/*")) { diff --git a/backend/views/comment/_form.php b/backend/views/comment/_form.php index 268da67..9c1db0c 100644 --- a/backend/views/comment/_form.php +++ b/backend/views/comment/_form.php @@ -29,7 +29,11 @@ JS;