/** * @Route("/create/comment", name="new_comment") */ public function newCommentAction($id) { if (!$this->get('security.authorization_checker')->isGranted('IS_AUTHENTICATED_FULLY')) { throw $this->createAccessDeniedException(); } $comment = new Comment(); $comment->setPostId($id); $form = $this->createForm('app_comment', $comment, array('action' => $this->generateUrl('check_comment'), 'method' => 'POST')); return $this->render("AppBundle:Comment:form.html.twig", array("commentForm" => $form->createView())); }
/** * {@inheritDoc} */ public function setPostId($postId) { $this->__initializer__ && $this->__initializer__->__invoke($this, 'setPostId', array($postId)); return parent::setPostId($postId); }