I am designing a Symfony bundle that has two distinct types of forms:
For the latter group, I need to inject some services and apply some customization. I'd prefer to do this without declaring each form as its own service.
My thought was to do this:
The goal here is to make it extremely simple to bake in this extended functionality to new forms, for example by extending a new type or implementing a marker interface.
I was able to make most of the above work with one exception: I could only do it if I tagged the extension to "form", which then applied it to all forms. I haven't been able to get an extension to only target a subset of forms.
Is there any way to do this, or will I have to live with a less elegant solution?