Bundle/TemplateBundle/Controller/TemplateController.php
public function editAction(Request $request, Template $template)
    {
        $em = $this->getDoctrine()->getManager();
        $form = $this->container->get('form.factory')->create(TemplateType::class, $template);

        $form->handleRequest($request);
        if ($form->isValid()) {
            $em->persist($template);
            $em->flush();

            return $this->redirect($this->generateUrl('victoire_template_show', ['id' => $template->getId()]));
        }

        return $this->redirect($this->generateUrl('victoire_template_settings', ['id' => $template->getId()]));
    }
public function editAction(Request $request, Template $template)
    {
        $em = $this->getDoctrine()->getManager();
        $form = $this->container->get('form.factory')->create(TemplateType::class, $template);

        $form->handleRequest($request);
        if ($form->isValid()) {
            $em->persist($template);
            $em->flush();

            return $this->redirect($this->generateUrl('victoire_template_show', ['id' => $template->getId()]));
        }

        return $this->redirect($this->generateUrl('victoire_template_settings', ['id' => $template->getId()]));
    }
public function editAction ( Request $ request , Template $ template ) { $ em = $ this -> getDoctrine ( ) -> getManager ( ) ; $ form = $ this -> container -> get ( 'form.factory' ) -> create ( TemplateType :: class , $ template ) ; $ form -> handleRequest ( $ request ) ; if ( $ form -> isValid ( ) ) { $ em -> persist ( $ template ) ; $ em -> flush ( ) ; return $ this -> redirect ( $ this -> generateUrl ( 'victoire_template_show' , [ 'id' => $ template -> getId ( ) ] ) ) ; } return $ this -> redirect ( $ this -> generateUrl ( 'victoire_template_settings' , [ 'id' => $ template -> getId ( ) ] ) ) ; }
edit a Template.

@param Template $template The Template to edit

@return \Symfony\Component\HttpFoundation\RedirectResponse
@Route("/edit/{slug}", name="victoire_template_edit")
@Configuration\Template()
@ParamConverter("template", class="VictoireTemplateBundle:Template")
edit a Template .