getComments(); $this->view->setVar('pager', $pager); } /** * @Post("/{id:[0-9]+}/update", name="admin.comment.update") */ public function updateAction($id) { $commentService = new CommentService(); $commentService->updateComment($id); $content = ['msg' => '更新评论成功']; return $this->jsonSuccess($content); } /** * @Post("/{id:[0-9]+}/delete", name="admin.comment.delete") */ public function deleteAction($id) { $commentService = new CommentService(); $commentService->deleteComment($id); $content = [ 'location' => $this->request->getHTTPReferer(), 'msg' => '删除评论成功', ]; return $this->jsonSuccess($content); } /** * @Post("/{id:[0-9]+}/restore", name="admin.comment.restore") */ public function restoreAction($id) { $commentService = new CommentService(); $commentService->restoreComment($id); $content = [ 'location' => $this->request->getHTTPReferer(), 'msg' => '还原评论成功', ]; return $this->jsonSuccess($content); } }