public function roomFormAction(Request $request)
    {
        $room = new Room();
        // Manage edition mode
        $this->currentRoom = $request->get('room');
        if ($this->currentRoom) {
            $room = $this->get("ydle.room.manager")->find($request->get('room'));
        }
        $action = $this->get('router')->generate('submitRoomForm', array('room' => $this->currentRoom));

        $form = $this->createForm("rooms_form", $room);
        $form->handleRequest($request);

        return $this->render('YdleHubBundle:Rooms:form.html.twig', array(
            'action' => $action,
            'form' => $form->createView()
        ));
    }
public function roomFormAction(Request $request)
    {
        $room = new Room();
        // Manage edition mode
        $this->currentRoom = $request->get('room');
        if ($this->currentRoom) {
            $room = $this->get("ydle.room.manager")->find($request->get('room'));
        }
        $action = $this->get('router')->generate('submitRoomForm', array('room' => $this->currentRoom));

        $form = $this->createForm("rooms_form", $room);
        $form->handleRequest($request);

        return $this->render('YdleHubBundle:Rooms:form.html.twig', array(
            'action' => $action,
            'form' => $form->createView()
        ));
    }
public function roomFormAction ( Request $ request ) { $ room = new Room ( ) ; // Manage edition mode $ this -> currentRoom = $ request -> get ( 'room' ) ; if ( $ this -> currentRoom ) { $ room = $ this -> get ( "ydle.room.manager" ) -> find ( $ request -> get ( 'room' ) ) ; } $ action = $ this -> get ( 'router' ) -> generate ( 'submitRoomForm' , array ( 'room' => $ this -> currentRoom ) ) ; $ form = $ this -> createForm ( "rooms_form" , $ room ) ; $ form -> handleRequest ( $ request ) ; return $ this -> render ( 'YdleHubBundle:Rooms:form.html.twig' , array ( 'action' => $ action , 'form' => $ form -> createView ( ) ) ) ; }
Display a form to create or edit a room

@param Request $request
Display a form to create or edit a room