mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 23:23:51 +00:00
Issue336 internal create action fixes
This commit is contained in:
@@ -110,6 +110,34 @@ class AccompanyingCourseController extends Controller
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Comments page of Accompanying Course section.
|
||||
*
|
||||
* @Route("/{_locale}/parcours/{accompanying_period_id}/comments", name="chill_person_accompanying_period_comment_list")
|
||||
* @ParamConverter("accompanyingCourse", options={"id": "accompanying_period_id"})
|
||||
*/
|
||||
public function commentAction(AccompanyingPeriod $accompanyingCourse, Request $request): Response
|
||||
{
|
||||
$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(),
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Edit page of Accompanying Course section.
|
||||
*
|
||||
@@ -217,35 +245,4 @@ class AccompanyingCourseController extends Controller
|
||||
'accompanying_period_id' => $period->getId(),
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Comments page of Accompanying Course section.
|
||||
*
|
||||
* @Route("/{_locale}/parcours/{accompanying_period_id}/comments", name="chill_person_accompanying_period_comment_list")
|
||||
* @ParamConverter("accompanyingCourse", options={"id": "accompanying_period_id"})
|
||||
*/
|
||||
public function commentAction(AccompanyingPeriod $accompanyingCourse, Request $request): Response
|
||||
{
|
||||
|
||||
$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()
|
||||
]);
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user