commments: add basic form in template

This commit is contained in:
2021-12-14 10:25:36 +01:00
parent 8b2a8544b8
commit 530267a9b0
3 changed files with 29 additions and 4 deletions

View File

@@ -227,22 +227,24 @@ class AccompanyingCourseController extends Controller
public function commentAction(AccompanyingPeriod $accompanyingCourse, Request $request): Response
{
/*
$form = $this->createForm(AccompanyingCourseCommentType::class, $comment, []);
$comment = new AccompanyingPeriod\Comment();
$form = $this->createForm(AccompanyingCourseCommentType::class, $comment, []);
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
$em = $this->getDoctrine()->getManager();
$em->persist($comment);
$em->flush();
return $this->redirectToRoute($route);
}
*/
return $this->render('@ChillPerson/AccompanyingCourse/comment_list.html.twig', [
'accompanyingCourse' => $accompanyingCourse,
// 'form' => $form->createView()
'form' => $form->createView()
]);
}