CoreExtraBundle/Controller/SliderController.php
public function editAction(Request $request, Slider $slider)
    {
        
        $deleteForm = $this->createDeleteForm($slider);
        $editForm = $this->createForm('CoreExtraBundle\Form\SliderType', $slider);
        $editForm->handleRequest($request);

        if ($editForm->isSubmitted() && $editForm->isValid()) {
            $em = $this->getDoctrine()->getManager();
            
            if($slider->getRemoveImage()){
                $slider->setImage(null);
            }
            
            $em->persist($slider);
            $em->flush();

            $this->get('session')->getFlashBag()->add('success', 'slider.edited');
            
            return $this->redirectToRoute('coreextra_slider_index');
        }

        return array(
            'entity' => $slider,
            'edit_form' => $editForm->createView(),
            'delete_form' => $deleteForm->createView(),
        );
    }
public function editAction(Request $request, Slider $slider)
    {
        
        $deleteForm = $this->createDeleteForm($slider);
        $editForm = $this->createForm('CoreExtraBundle\Form\SliderType', $slider);
        $editForm->handleRequest($request);

        if ($editForm->isSubmitted() && $editForm->isValid()) {
            $em = $this->getDoctrine()->getManager();
            
            if($slider->getRemoveImage()){
                $slider->setImage(null);
            }
            
            $em->persist($slider);
            $em->flush();

            $this->get('session')->getFlashBag()->add('success', 'slider.edited');
            
            return $this->redirectToRoute('coreextra_slider_index');
        }

        return array(
            'entity' => $slider,
            'edit_form' => $editForm->createView(),
            'delete_form' => $deleteForm->createView(),
        );
    }
public function editAction ( Request $ request , Slider $ slider ) { $ deleteForm = $ this -> createDeleteForm ( $ slider ) ; $ editForm = $ this -> createForm ( 'CoreExtraBundle\Form\SliderType' , $ slider ) ; $ editForm -> handleRequest ( $ request ) ; if ( $ editForm -> isSubmitted ( ) && $ editForm -> isValid ( ) ) { $ em = $ this -> getDoctrine ( ) -> getManager ( ) ; if ( $ slider -> getRemoveImage ( ) ) { $ slider -> setImage ( null ) ; } $ em -> persist ( $ slider ) ; $ em -> flush ( ) ; $ this -> get ( 'session' ) -> getFlashBag ( ) -> add ( 'success' , 'slider.edited' ) ; return $ this -> redirectToRoute ( 'coreextra_slider_index' ) ; } return array ( 'entity' => $ slider , 'edit_form' => $ editForm -> createView ( ) , 'delete_form' => $ deleteForm -> createView ( ) , ) ; }
Displays a form to edit an existing Slider entity.

@Route("/{id}/edit")
@Method({"GET", "POST"})
@Template()
@I18nDoctrine
Displays a form to edit an existing Slider entity .