Example #1
0
 /**
  * Displays a form to create a new Question entity.
  *
  * @Route("/new/{id}", name="question_new")
  * @Method("GET")
  * @Template("AppBundle:Shared:new.html.twig")
  */
 public function newAction($id)
 {
     $em = $this->getDoctrine()->getManager();
     $questionset = $em->getRepository('AppBundle:Questionset')->find($id);
     $entity = new Question();
     $entity->setQuestionset($questionset);
     $form = $this->createCreateForm($entity);
     return array('entity' => $entity, 'form' => $form->createView());
 }