A form is just an object, it does not know what its layout should be - what the template is for. If you use a controller that leaves the default controller, you can get the HTML code of the rendered template as follows: $html = $this->renderView('YourAppBundle:Blah:form.html.twig', array('form' => $form->createView() ) ); where this template contains the markup / rendering code of the form.
source share