Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * @Route("/accept", name="accept")
- */
- public function acceptAction(Request $request)
- {
- $accept = new Accept();
- $form = $this->getAcceptForm($accept);
- $form->handleRequest($request);
- if ($form->isSubmitted() && $form->isValid()) {
- $this->infosRepository->save($accept);
- $this->mailerService->send('New accept', $accept);
- $this->addFlash('success', 'Accept ok');
- return $this->redirectToRoute('confirmed');
- }
- return $this->render('homepage/form.html.twig', [
- 'infos' => $this->infosRepository->getAllActive();
- 'form' => $form->createView()
- ]);
- }
- private function getAcceptForm(Accept $accept){
- return $this->createForm(AcceptType::class, $accept);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement