Quantcast
Channel: Active questions tagged symfony4 - Stack Overflow
Viewing all articles
Browse latest Browse all 3924

In Symfony4 update function not working,after values fetch from database

$
0
0

I'm new to Symfony.I made a form with insert,delete,view,update. In view page i added a edit button which is used to update the values.when i submit the form after change the values in form values will not updated in output.Please share your thoughts.

Thank You...

here i attached my controller code

/** 
* @Route("/update/{id}", name="update") 
*/ 
//edit function
public function edit($id,Request $request,Ramsurath $ramsurath) :Response
{
    $form = $this->createForm(RamsurathType::class, $ramsurath);
    $form->handleRequest($request);
    if ($form->isSubmitted() && $form->isValid()) 
        {
          $this->getDoctrine()->getManager()->flush();
          return $this->redirectToRoute('index');
        }
    return $this->render('ramsurath/update.html.twig',        
    ['ramsurath'=>$ramsurath,'form' => $form->createView()]);
}

Viewing all articles
Browse latest Browse all 3924

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>