src/GPublicationBundle/Controller/ReactionController.php
/**
     * Displays a form to edit an existing reaction entity.
     *
     * @Route("/{id}/edit", name="reaction_edit")
     * @Method({"GET", "POST"})
     */
Displays a form to edit an existing reaction entity.
Displays a form to edit an existing reaction entity .
public function editAction(Request $request, Reaction $reaction)
    {
        $deleteForm = $this->createDeleteForm($reaction);
        $editForm = $this->createForm('GPublicationBundle\Form\ReactionType', $reaction);
        $editForm->handleRequest($request);
        if ($editForm->isSubmitted() && $editForm->isValid()) {
            $this->getDoctrine()->getManager()->flush();
            return $this->redirectToRoute('reaction_index');
        }
        return $this->render('reaction/edit.html.twig', array(
            'reaction' => $reaction,
            'edit_form' => $editForm->createView(),
            'delete_form' => $deleteForm->createView(),
        ));
    }
public function editAction ( Request $ request , Reaction $ reaction ) { $ deleteForm = $ this -> createDeleteForm ( $ reaction ) ; $ editForm = $ this -> createForm ( 'GPublicationBundle\Form\ReactionType' , $ reaction ) ; $ editForm -> handleRequest ( $ request ) ; if ( $ editForm -> isSubmitted ( ) && $ editForm -> isValid ( ) ) { $ this -> getDoctrine ( ) -> getManager ( ) -> flush ( ) ; return $ this -> redirectToRoute ( 'reaction_index' ) ; } return $ this -> render ( 'reaction/edit.html.twig' , array ( 'reaction' => $ reaction , 'edit_form' => $ editForm -> createView ( ) , 'delete_form' => $ deleteForm -> createView ( ) , ) ) ; }
Displays a form to edit an existing reaction entity.
Displays a form to edit an existing reaction entity .