Skip to content

Instantly share code, notes, and snippets.

@oaltman
Created May 28, 2013 13:27
Show Gist options
  • Save oaltman/5662751 to your computer and use it in GitHub Desktop.
Save oaltman/5662751 to your computer and use it in GitHub Desktop.
NewAction
/**
* @Route("/{room}/new", name="model_new")
* @Template()
*/
public function newAction(Request $request,$room)
{
$form = $this->createForm(new RoomModelType(), new RoomModel());
if($request->isMethod('POST'))
{
// ulozeni do DB
}
return array(
'form' => $form->createView()
, 'url' => $this->generateUrl('model_new',array('room' => $room))
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment