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(),
        );
    }