src/EventsBundle/Controller/agendaController.php
/**
     * Creates a new agenda entity.
     *
     */
Creates a new agenda entity.
Creates a new agenda entity .
public function newAction(Request $request)
    {
        $agenda = new Agenda();
        $form = $this->createForm('EventsBundle\Form\agendaType', $agenda);
        $form->handleRequest($request);
        if ($form->isSubmitted() && $form->isValid()) {
            $em = $this->getDoctrine()->getManager();
            $em->persist($agenda);
            $em->flush($agenda);
            return $this->redirectToRoute('agenda_show', array('id' => $agenda->getId()));
        }
        return $this->render('agenda/new.html.twig', array(
            'agenda' => $agenda,
            'form' => $form->createView(),
        ));
    }
public function newAction ( Request $ request ) { $ agenda = new Agenda ( ) ; $ form = $ this -> createForm ( 'EventsBundle\Form\agendaType' , $ agenda ) ; $ form -> handleRequest ( $ request ) ; if ( $ form -> isSubmitted ( ) && $ form -> isValid ( ) ) { $ em = $ this -> getDoctrine ( ) -> getManager ( ) ; $ em -> persist ( $ agenda ) ; $ em -> flush ( $ agenda ) ; return $ this -> redirectToRoute ( 'agenda_show' , array ( 'id' => $ agenda -> getId ( ) ) ) ; } return $ this -> render ( 'agenda/new.html.twig' , array ( 'agenda' => $ agenda , 'form' => $ form -> createView ( ) , ) ) ; }
Creates a new agenda entity.
Creates a new agenda entity .