public function selectAction($id)
    {
        $instance = $this->getManager()->find($id);
        // If instance exists
        if($instance) {
            $this->getRequest()->getSession()->set('instance', $instance);
            if($this->getWorker()) {
                $this->get('session')->getFlashBag()->add('success', 'Instance '.$instance->getName().' selected');
            }else {
                $this->get('session')->getFlashBag()->add('error', 'Instance '.$instance->getName().' cannot be selected');
            }
        }else {
            $this->get('session')->getFlashBag()->add('error', 'This instance does not exist');
        }
        
        return new RedirectResponse($this->generateUrl('ringo_php_redmon'));
    }
public function selectAction($id)
    {
        $instance = $this->getManager()->find($id);
        // If instance exists
        if($instance) {
            $this->getRequest()->getSession()->set('instance', $instance);
            if($this->getWorker()) {
                $this->get('session')->getFlashBag()->add('success', 'Instance '.$instance->getName().' selected');
            }else {
                $this->get('session')->getFlashBag()->add('error', 'Instance '.$instance->getName().' cannot be selected');
            }
        }else {
            $this->get('session')->getFlashBag()->add('error', 'This instance does not exist');
        }
        
        return new RedirectResponse($this->generateUrl('ringo_php_redmon'));
    }
public function selectAction ( $ id ) { $ instance = $ this -> getManager ( ) -> find ( $ id ) ; // If instance exists if ( $ instance ) { $ this -> getRequest ( ) -> getSession ( ) -> set ( 'instance' , $ instance ) ; if ( $ this -> getWorker ( ) ) { $ this -> get ( 'session' ) -> getFlashBag ( ) -> add ( 'success' , 'Instance ' . $ instance -> getName ( ) . ' selected' ) ; } else { $ this -> get ( 'session' ) -> getFlashBag ( ) -> add ( 'error' , 'Instance ' . $ instance -> getName ( ) . ' cannot be selected' ) ; } } else { $ this -> get ( 'session' ) -> getFlashBag ( ) -> add ( 'error' , 'This instance does not exist' ) ; } return new RedirectResponse ( $ this -> generateUrl ( 'ringo_php_redmon' ) ) ; }
Select action
Change the current instance

@param string $id
@return \Symfony\Component\HttpFoundation\RedirectResponse
Select action Change the current instance