src/Cpm/JovenesBundle/Controller/RegionEducativaController.php
/**
     * Creates a new RegionEducativa entity.
     *
     * @Route("/create", name="region_create")
     * @Method("post")
     * @Template("CpmJovenesBundle:RegionEducativa:new.html.twig")
     */
Creates a new RegionEducativa entity.
Creates a new RegionEducativa entity .
public function createAction()
    {
        $entity  = new RegionEducativa();
        $request = $this->getRequest();
        $form    = $this->createForm(new RegionEducativaType(), $entity);
        $form->bindRequest($request);
        if ($form->isValid()) {
            $em = $this->getDoctrine()->getEntityManager();
            $em->persist($entity);
            $em->flush();
            return $this->redirect($this->generateUrl('region'));
        }
        return array(
            'entity' => $entity,
            'form'   => $form->createView()
        );
    }
public function createAction ( ) { $ entity = new RegionEducativa ( ) ; $ request = $ this -> getRequest ( ) ; $ form = $ this -> createForm ( new RegionEducativaType ( ) , $ entity ) ; $ form -> bindRequest ( $ request ) ; if ( $ form -> isValid ( ) ) { $ em = $ this -> getDoctrine ( ) -> getEntityManager ( ) ; $ em -> persist ( $ entity ) ; $ em -> flush ( ) ; return $ this -> redirect ( $ this -> generateUrl ( 'region' ) ) ; } return array ( 'entity' => $ entity , 'form' => $ form -> createView ( ) ) ; }
Creates a new RegionEducativa entity.
Creates a new RegionEducativa entity .