src/CentraleLille/SearchBundle/Controller/DemoController.php
/**
     * Displays a form to edit an existing Demo entity.
     *
     * @Route("/{id}/edit", name="demo_edit")
     * @Method({"GET", "POST"})
     */
Displays a form to edit an existing Demo entity.
Displays a form to edit an existing Demo entity .
public function editAction(Request $request, Demo $demo)
    {
        $deleteForm = $this->createDeleteForm($demo);
        $editForm = $this->createForm('CentraleLille\SearchBundle\Form\DemoType', $demo);
        $editForm->handleRequest($request);
        if ($editForm->isSubmitted() && $editForm->isValid()) {
            $em = $this->getDoctrine()->getManager();
            $em->persist($demo);
            $em->flush();
            return $this->redirectToRoute('demo_edit', array('id' => $demo->getId()));
        }
        return $this->render('demo/edit.html.twig', array(
            'demo' => $demo,
            'edit_form' => $editForm->createView(),
            'delete_form' => $deleteForm->createView(),
        ));
    }
public function editAction ( Request $ request , Demo $ demo ) { $ deleteForm = $ this -> createDeleteForm ( $ demo ) ; $ editForm = $ this -> createForm ( 'CentraleLille\SearchBundle\Form\DemoType' , $ demo ) ; $ editForm -> handleRequest ( $ request ) ; if ( $ editForm -> isSubmitted ( ) && $ editForm -> isValid ( ) ) { $ em = $ this -> getDoctrine ( ) -> getManager ( ) ; $ em -> persist ( $ demo ) ; $ em -> flush ( ) ; return $ this -> redirectToRoute ( 'demo_edit' , array ( 'id' => $ demo -> getId ( ) ) ) ; } return $ this -> render ( 'demo/edit.html.twig' , array ( 'demo' => $ demo , 'edit_form' => $ editForm -> createView ( ) , 'delete_form' => $ deleteForm -> createView ( ) , ) ) ; }
Displays a form to edit an existing Demo entity.
Displays a form to edit an existing Demo entity .