Bundle/CoreBundle/Controller/SwitchController.php
public function switchModeAction($mode)
    {
        //the session
        $session = $this->get('session');

        //memorize that we are in edit mode
        $session->set('victoire.edit_mode', $mode);

        return new JsonResponse(
            ['response' => true]
        );
    }
public function switchModeAction($mode)
    {
        //the session
        $session = $this->get('session');

        //memorize that we are in edit mode
        $session->set('victoire.edit_mode', $mode);

        return new JsonResponse(
            ['response' => true]
        );
    }
public function switchModeAction ( $ mode ) { //the session $ session = $ this -> get ( 'session' ) ; //memorize that we are in edit mode $ session -> set ( 'victoire.edit_mode' , $ mode ) ; return new JsonResponse ( [ 'response' => true ] ) ; }
Method used to change of edit mode.

@param string $mode The mode

@Route("/mode/{mode}", name="victoire_core_switchMode", options={"expose"=true})

@return JsonResponse Empty response
Method used to change of edit mode .