public function updateAction($id)
    {
        $form = $this->getForm();
        // Get request
        $request = $this->get('request');
        if ('POST' == $request->getMethod()) {
            $form->submit($request);
            
            if ($form->isValid()) {
                // Save instance
                $this->getManager()->create($form->getData());
                $this->get('session')->getFlashBag()->add('success', 'Instance Redis updated successfully');

                return new RedirectResponse($this->generateUrl('ringo_php_redmon'));
            }else {
                $this->get('session')->getFlashBag()->add('error', 'Some errors found');
            }
        }
        
        return $this->render(
            $this->getTemplatePath().'edit.html.twig',
            array(
                'form' => $form->createView(),
                'errors' => $form->getErrors()
            )
        );
    }
public function updateAction($id)
    {
        $form = $this->getForm();
        // Get request
        $request = $this->get('request');
        if ('POST' == $request->getMethod()) {
            $form->submit($request);
            
            if ($form->isValid()) {
                // Save instance
                $this->getManager()->create($form->getData());
                $this->get('session')->getFlashBag()->add('success', 'Instance Redis updated successfully');

                return new RedirectResponse($this->generateUrl('ringo_php_redmon'));
            }else {
                $this->get('session')->getFlashBag()->add('error', 'Some errors found');
            }
        }
        
        return $this->render(
            $this->getTemplatePath().'edit.html.twig',
            array(
                'form' => $form->createView(),
                'errors' => $form->getErrors()
            )
        );
    }
public function updateAction ( $ id ) { $ form = $ this -> getForm ( ) ; // Get request $ request = $ this -> get ( 'request' ) ; if ( 'POST' == $ request -> getMethod ( ) ) { $ form -> submit ( $ request ) ; if ( $ form -> isValid ( ) ) { // Save instance $ this -> getManager ( ) -> create ( $ form -> getData ( ) ) ; $ this -> get ( 'session' ) -> getFlashBag ( ) -> add ( 'success' , 'Instance Redis updated successfully' ) ; return new RedirectResponse ( $ this -> generateUrl ( 'ringo_php_redmon' ) ) ; } else { $ this -> get ( 'session' ) -> getFlashBag ( ) -> add ( 'error' , 'Some errors found' ) ; } } return $ this -> render ( $ this -> getTemplatePath ( ) . 'edit.html.twig' , array ( 'form' => $ form -> createView ( ) , 'errors' => $ form -> getErrors ( ) ) ) ; }
Update instance action

@param string $id The instance ID
@return \Symfony\Component\HttpFoundation\RedirectResponse
Update instance action