DEV Community

Discussion on: Using symfony forms without sacrificing your domain

Collapse
 
ashm_18 profile image
ash-m • Edited

Just a note: You're missing the obligatory extends AbstractController required for $this->createForm()

Personally, I'm not a fan of service locators or static factory methods in the Controller, though I'm willing to bet you can probably typehint the FormBuilder interface if you really want to inject it. That said, not sure about using ->submit(), but I guess that gets around some of the necessary extensions provided when going the default route (ie, the official docs recommend using ->handleRequest() which I don't know is possible without the HttpExtension, and then at that point you probably want to configure that outside of the controller somewhere)

That's my 2 cents. What are you're thoughts?