1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
public function modifierAction($id)
{
$repository = $this->getDoctrine()->getManager()->getRepository('MeteoApplisAdminBundle:ConfIndicateurs');
$indicateur = $repository->find($id);
$form = $this->createForm(new ConfIndicateursType, $indicateur);
$request = $this->get('request');
if($request->getMethod() == 'POST')
{
$form->bind($request);
if($form->isValid())
{
$em = $this->getDoctrine()->getEntityManager();
$em->persist($indicateur);
$em->flush();
return $this->redirect($this->generateUrl('meteo_applis_admin_indicateurs'));
}
}
return $this->render('MeteoApplisAdminBundle:Admin:Indicateurs/indicateurs_modifier.html.twig', array(
'indicateur' => $indicateur,
'form' => $form->createView(),
));
} |
Partager