/** * @Route("/{id}", name="app_blog_show", requirements={ "id"="\d+" }) * @Method("GET") */ public function showAction(Blog $blog) { $comments = $this->getDoctrine()->getRepository('AppBundle:Comment')->getCommentsForBlog($blog->getId()); return $this->render('blog/show.html.twig', ['blog' => $blog, 'comments' => $comments]); }
private function createCommentForm(Comment $comment, Blog $blog) { return $this->createForm('app_comment', $comment, ['action' => $this->generateUrl('app_add_comment', ['id' => $blog->getId()])]); }