|
@@ 69-75 (lines=7) @@
|
| 66 |
|
$form = $this->createForm(\AppBundle\Form\SurveyType::class, $survey); |
| 67 |
|
$form->handleRequest($request); |
| 68 |
|
|
| 69 |
|
if ($form->isSubmitted() && $form->isValid()) { |
| 70 |
|
$em = $this->getDoctrine()->getManager(); |
| 71 |
|
$em->persist($survey); |
| 72 |
|
$em->flush(); |
| 73 |
|
|
| 74 |
|
return $this->redirectToRoute('surveys'); |
| 75 |
|
} |
| 76 |
|
|
| 77 |
|
return $this->render('@App/surveyform.html.twig', array( |
| 78 |
|
'form' => $form->createView(), |
|
@@ 102-108 (lines=7) @@
|
| 99 |
|
$form = $this->createForm(\AppBundle\Form\SurveyType::class, $survey); |
| 100 |
|
$form->handleRequest($request); |
| 101 |
|
|
| 102 |
|
if ($form->isSubmitted() && $form->isValid()) { |
| 103 |
|
$em = $this->getDoctrine()->getManager(); |
| 104 |
|
$em->remove($survey); |
| 105 |
|
$em->flush(); |
| 106 |
|
|
| 107 |
|
return $this->redirectToRoute('surveys'); |
| 108 |
|
} |
| 109 |
|
|
| 110 |
|
return $this->render('@App/survey.html.twig', array( |
| 111 |
|
'form' => $form->createView(), 'survey' => $survey, 'question_answers' => $questionAnswer, |