Advertisement
Guest User

Untitled

a guest
May 21st, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. /**
  2. * @Route("/projekt/dodaj", name="project_add")
  3. */
  4. public function addAction(Request $request) {
  5. $doctrine = $this->getDoctrine()->getManager();
  6.  
  7.  
  8. $newProject = new Project();
  9. $form = $this->createForm(ProjectType::class, $newProject, array());
  10.  
  11.  
  12. if($request->getMethod() == 'POST'){
  13.  
  14. $form->handleRequest($request);
  15.  
  16. if($form->isValid()){
  17. $doctrine->persist($newProject);
  18. $doctrine->flush();
  19. }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement