|
@@ 86-92 (lines=7) @@
|
| 83 |
|
$form = $this->createForm(\AppBundle\Form\SurveyType::class, $survey); |
| 84 |
|
$form->handleRequest($request); |
| 85 |
|
|
| 86 |
|
if ($form->isSubmitted() && $form->isValid()) { |
| 87 |
|
$em = $this->getDoctrine()->getManager(); |
| 88 |
|
$em->persist($survey); |
| 89 |
|
$em->flush(); |
| 90 |
|
|
| 91 |
|
return $this->redirectToRoute('surveys'); |
| 92 |
|
} |
| 93 |
|
|
| 94 |
|
return $this->render('@App/surveyform.html.twig', array( |
| 95 |
|
'form' => $form->createView(), |
|
@@ 121-127 (lines=7) @@
|
| 118 |
|
$form = $this->createForm(\AppBundle\Form\SurveyType::class, $survey); |
| 119 |
|
$form->handleRequest($request); |
| 120 |
|
|
| 121 |
|
if ($form->isSubmitted() && $form->isValid()) { |
| 122 |
|
$em = $this->getDoctrine()->getManager(); |
| 123 |
|
$em->remove($survey); |
| 124 |
|
$em->flush(); |
| 125 |
|
|
| 126 |
|
return $this->redirectToRoute('surveys'); |
| 127 |
|
} |
| 128 |
|
|
| 129 |
|
return $this->render('@App/survey.html.twig', array( |
| 130 |
|
'form' => $form->createView(), 'survey' => $survey, 'question_answers' => $questionAnswer, |