SHARE
TWEET

Untitled

a guest Jul 22nd, 2019 55 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public function addAlerta(Request $request)
  2. {
  3.  
  4.  $contractacioid=$request->query->get('id');
  5.  $int = (int)$contractacioid;
  6.  
  7.  //var_dump($int);
  8.  
  9.  
  10.     $alerta = new Alertes();
  11.     $form = $this->createForm(AlertesType::class, $alerta);
  12.     $form->handleRequest($request);
  13.  
  14.  
  15.  
  16.     if ($form->isSubmitted()){
  17.  
  18.         $em = $this->getDoctrine()->getManager();
  19.         $alerta->setContractacio($int);
  20.         $em->persist($alerta);
  21.         $em->flush();
  22.  
  23.         return $this->redirectToRoute('view_alertes');
  24.     }
  25.  
  26.  
  27.  
  28.     return $this->render('alertes/addAlerta.html.twig', [
  29.         'form' => $form -> createView()
  30.     ]);
  31. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top