How to do a redirect and pass the previously filled form data in Symfony?

I have processed the form
$form->handleRequest($request);

 if ($form->is submitted() && $form->isValid()) {
 $stripePlanCreateDTO = $form->getData();
 try {
 $stripePlan =
$this->stripePlanService->createStripePlan(
$stripePlanCreateDTO
);
 } catch (UserExceptionInterface $e) {
$this->addFlash(
'error',
$e->getMessage()
);

 return $this->redirectToRoute(
'admin.stripe_plans.create'
);
}

$this->addFlash(
'success',
$stripePlan->name()
 . ' was added successfully.'
);

 return $this->redirectToRoute('admin.stripe_plans.get_all');
 }


The problem is that if there is an exception and a redirect happens, it is clear that the form data that the user has already filled, will be lost. In laravale you can do something like return back()->withErrors([$e->getMessage()])->withInput(); but how to do it on sifani, tell me, please
March 20th 20 at 11:53
0 answer

Find more questions by tags Symfony