src/AppBundle/Controller/MarinaHumedaServicioController.php
/**
     * Creates a new marinaHumedaServicio entity.
     *
     * @Route("/nuevo", name="marina-humeda-servicio_new")
     * @Method({"GET", "POST"})
     */
Creates a new marinaHumedaServicio entity.
Creates a new marinaHumedaServicio entity .
public function newAction(Request $request)
    {
        $marinaHumedaServicio = new Marinahumedaservicio();
        $form = $this->createForm('AppBundle\Form\MarinaHumedaServicioType', $marinaHumedaServicio);
        $form->handleRequest($request);
        if ($form->isSubmitted() && $form->isValid()) {
            $em = $this->getDoctrine()->getManager();
            $em->persist($marinaHumedaServicio);
            $em->flush();
            return $this->redirectToRoute('marina-humeda-servicio_index');
        }
        return $this->render('marinahumeda/servicio/new.html.twig', [
            'title' => 'Nuevo servicio',
            'marinaHumedaServicio' => $marinaHumedaServicio,
            'form' => $form->createView(),
        ]);
    }
public function newAction ( Request $ request ) { $ marinaHumedaServicio = new Marinahumedaservicio ( ) ; $ form = $ this -> createForm ( 'AppBundle\Form\MarinaHumedaServicioType' , $ marinaHumedaServicio ) ; $ form -> handleRequest ( $ request ) ; if ( $ form -> isSubmitted ( ) && $ form -> isValid ( ) ) { $ em = $ this -> getDoctrine ( ) -> getManager ( ) ; $ em -> persist ( $ marinaHumedaServicio ) ; $ em -> flush ( ) ; return $ this -> redirectToRoute ( 'marina-humeda-servicio_index' ) ; } return $ this -> render ( 'marinahumeda/servicio/new.html.twig' , [ 'title' => 'Nuevo servicio' , 'marinaHumedaServicio' => $ marinaHumedaServicio , 'form' => $ form -> createView ( ) , ] ) ; }
Creates a new marinaHumedaServicio entity.
Creates a new marinaHumedaServicio entity .