src/AppBundle/Controller/Tienda/PeticionController.php
/**
     * Creates a new peticion entity.
     *
     * @Route("/new", name="tienda_peticion_new")
     * @Method({"GET", "POST"})
     */
Creates a new peticion entity.
Creates a new peticion entity .
public function newAction(Request $request)
    {
        $peticion = new Peticion();
        $form = $this->createForm('AppBundle\Form\Tienda\PeticionType', $peticion);
        $form->handleRequest($request);
        if ($form->isSubmitted() && $form->isValid()) {
            $em = $this->getDoctrine()->getManager();
            $em->persist($peticion);
            $em->flush();
            return $this->redirectToRoute('tienda_peticion_show', array('id' => $peticion->getId()));
        }
        return $this->render('tienda/peticion/new.html.twig', array(
            'peticion' => $peticion,
            'form' => $form->createView(),
        ));
    }
public function newAction ( Request $ request ) { $ peticion = new Peticion ( ) ; $ form = $ this -> createForm ( 'AppBundle\Form\Tienda\PeticionType' , $ peticion ) ; $ form -> handleRequest ( $ request ) ; if ( $ form -> isSubmitted ( ) && $ form -> isValid ( ) ) { $ em = $ this -> getDoctrine ( ) -> getManager ( ) ; $ em -> persist ( $ peticion ) ; $ em -> flush ( ) ; return $ this -> redirectToRoute ( 'tienda_peticion_show' , array ( 'id' => $ peticion -> getId ( ) ) ) ; } return $ this -> render ( 'tienda/peticion/new.html.twig' , array ( 'peticion' => $ peticion , 'form' => $ form -> createView ( ) , ) ) ; }
Creates a new peticion entity.
Creates a new peticion entity .