src/AppBundle/Controller/Admin/NotificationController.php
/**
     * Creates a new Notification config entity.
     *
     * @Route("/new", name="admin_notification_new")
     * @Method({"GET", "POST"})
     *
     * NOTE: the Method annotation is optional, but it's a recommended practice
     * to constraint the HTTP methods each controller responds to (by default
     * it responds to all methods).
     */
Creates a new Notification config entity.

the Method annotation is optional, but it's a recommended practice
to constraint the HTTP methods each controller responds to (by default
it responds to all methods).
Creates a new Notification config entity . the Method annotation is optional but it ' s a recommended practice to constraint the HTTP methods each controller responds to ( by default it responds to all methods ) .
public function newAction(Request $request)
    {
        $notification = new NotificationConfig();
        $form = $this->createForm(NotificationConfigType::class, $notification)
            ->add('saveAndCreateNew', SubmitType::class);
        $form->handleRequest($request);
        if ($form->isSubmitted() && $form->isValid()) {
            $em = $this->getDoctrine()->getManager();
            $em->persist($notification);
            $em->flush();
            $this->addFlash('success', ' Notification Config created_successfully');
            return $this->redirectToRoute('admin_notification_config');
        }
        return $this->render('admin/notification/new.html.twig', [
            'form' => $form->createView(),
        ]);
    }
public function newAction ( Request $ request ) { $ notification = new NotificationConfig ( ) ; $ form = $ this -> createForm ( NotificationConfigType :: class , $ notification ) -> add ( 'saveAndCreateNew' , SubmitType :: class ) ; $ form -> handleRequest ( $ request ) ; if ( $ form -> isSubmitted ( ) && $ form -> isValid ( ) ) { $ em = $ this -> getDoctrine ( ) -> getManager ( ) ; $ em -> persist ( $ notification ) ; $ em -> flush ( ) ; $ this -> addFlash ( 'success' , ' Notification Config created_successfully' ) ; return $ this -> redirectToRoute ( 'admin_notification_config' ) ; } return $ this -> render ( 'admin/notification/new.html.twig' , [ 'form' => $ form -> createView ( ) , ] ) ; }
Creates a new Notification config entity.
Creates a new Notification config entity .