Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function addAction(Request $request)
- {
- $form = $this->createForm(MoviePersonForm::class);
- $form->handleRequest($request);
- if($form->isSubmitted() && $form->isValid())
- {
- $movie = new Movie();
- $movie['name'] = $form['movie_name']->getData();
- $movie['year'] = $form['movie_year']->getData();
- $movie['description'] = $form['movie_description']->getData();
- $em = $this->getDoctrine()->getManager();
- $em->persist($movie);
- $em->flush();
- $this->addFlash('success', 'Movie created');
- return $this->redirectToRoute('cms_list_movie');
- }
- return $this->render('cms/movie/crew.html.twig',[
- 'MoviePersonForm' => $form->createView()
- ]);
- }
Add Comment
Please, Sign In to add comment