src/AppBundle/Controller/EventoController.php
/**
     * Displays a form to edit an existing evento entity.
     *
     * @Route("/{id}/editar", name="evento_edit")
     * @Method({"GET", "POST"})
     */
Displays a form to edit an existing evento entity.
Displays a form to edit an existing evento entity .
public function editAction(Request $request, Evento $evento)
    {
        $this->denyAccessUnlessGranted('AGENDA_EDIT',$evento);
        $deleteForm = $this->createDeleteForm($evento);
        $editForm = $this->createForm('AppBundle\Form\EventoType', $evento);
        $editForm->handleRequest($request);
        if ($editForm->isSubmitted() && $editForm->isValid()) {
            $this->getDoctrine()->getManager()->flush();
            return $this->redirectToRoute('evento_show', ['id' => $evento->getId()]);
        }
        return $this->render('evento/edit.html.twig', [
            'evento' => $evento,
            'edit_form' => $editForm->createView(),
            'delete_form' => $deleteForm->createView(),
        ]);
    }
public function editAction ( Request $ request , Evento $ evento ) { $ this -> denyAccessUnlessGranted ( 'AGENDA_EDIT' , $ evento ) ; $ deleteForm = $ this -> createDeleteForm ( $ evento ) ; $ editForm = $ this -> createForm ( 'AppBundle\Form\EventoType' , $ evento ) ; $ editForm -> handleRequest ( $ request ) ; if ( $ editForm -> isSubmitted ( ) && $ editForm -> isValid ( ) ) { $ this -> getDoctrine ( ) -> getManager ( ) -> flush ( ) ; return $ this -> redirectToRoute ( 'evento_show' , [ 'id' => $ evento -> getId ( ) ] ) ; } return $ this -> render ( 'evento/edit.html.twig' , [ 'evento' => $ evento , 'edit_form' => $ editForm -> createView ( ) , 'delete_form' => $ deleteForm -> createView ( ) , ] ) ; }
Displays a form to edit an existing evento entity.
Displays a form to edit an existing evento entity .