/** * @ParamConverter("comment", class="AppBundle:Comment", options={"mapping":{"comment_id" = "id"}}) */ public function deleteAction(Request $request, Comment $comment) { $idea = $comment->getIdea(); $user = $idea->getUser(); $responseData = $this->get('app.model.comment')->delete($comment); if ($responseData['valid']) { //$this->get('session')->getFlashBag()->add('success', "Comment were deleted."); return $this->redirectToRoute('app_idea_view', ['user_username' => $user->getUsername(), 'idea_slug' => $idea->getSlug()]); } else { throw $this->createNotFoundException(); } }