src/EntraideBundle/Controller/donController.php
/**
     * Displays a form to edit an existing don entity.
     *
     */
Displays a form to edit an existing don entity.
Displays a form to edit an existing don entity .
public function editAction(Request $request, don $don)
    {
        $deleteForm = $this->createDeleteForm($don);
        $editForm = $this->createForm('EntraideBundle\Form\donType', $don);
        $editForm->handleRequest($request);
        if ($editForm->isSubmitted() && $editForm->isValid()) {
            $don->setDate(new \DateTime);
            $this->getDoctrine()->getManager()->flush();
            return $this->redirectToRoute('don_edit', array('id' => $don->getId()));
        }
        return $this->render('don/edit.html.twig', array(
            'don' => $don,
            'edit_form' => $editForm->createView(),
            'delete_form' => $deleteForm->createView(),
        ));
    }
public function editAction ( Request $ request , don $ don ) { $ deleteForm = $ this -> createDeleteForm ( $ don ) ; $ editForm = $ this -> createForm ( 'EntraideBundle\Form\donType' , $ don ) ; $ editForm -> handleRequest ( $ request ) ; if ( $ editForm -> isSubmitted ( ) && $ editForm -> isValid ( ) ) { $ don -> setDate ( new \ DateTime ) ; $ this -> getDoctrine ( ) -> getManager ( ) -> flush ( ) ; return $ this -> redirectToRoute ( 'don_edit' , array ( 'id' => $ don -> getId ( ) ) ) ; } return $ this -> render ( 'don/edit.html.twig' , array ( 'don' => $ don , 'edit_form' => $ editForm -> createView ( ) , 'delete_form' => $ deleteForm -> createView ( ) , ) ) ; }
Displays a form to edit an existing don entity.
Displays a form to edit an existing don entity .