- Where Developers Learn, Share, & Build Careers
How do I present a form in a controller (not in a template)? I look like something:
$ form = $ this- & gt; CreateForm (... $ output = $ form-> render); $ will be html for the output form.
The form is only an object, it is not known what the layout should be --- this is That's what the template is for. If you are expanding a controller with the default controller, then you can get the HTML of a rendered template like this: $ Html = $ this-> Renderview ('YourAppBundle: Blah: form.html.twig', array ('form' = & gt; createView ()); Form markup / rendering code in that template.
Comments
Post a Comment