You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
have you ever need to add different types of forms based on provided document type? I'm trying to achieve something like collection behavior with all allow add , allow delete functionality, but with my own form types, so I can't settle with generated ones.
Thank for any advice
The text was updated successfully, but these errors were encountered:
I'm using KNP Labs ORM Behavior modified for ODM with a2Lix translations bundle. I also have some special types, based on document, which I use for better selecting images (Referenced document). So I need to be able to specifiy form type and pass it to the form builder. Which I can't if collection is made dynamically, like you can add or delete new ones, but symfony won't recognize my own types and use default ones,. So I need to be able to loop through the embedded documents and add dynamically these new forms from them. Which is OK, each document know which form it needs.
But I don't know if this is correct aproach. It just sound natural to being able to mix document types in single collection of embedded documents, so I thought there is some way how to mix form types as well.
I thought there is some way how to mix form types as well.
That is good question for Symfony 👶 Anyway we have done something like this (unfortunately can't share the exact solution), we ended up extending collection type and having subscribers on PRE_SUBMIT and PRE_SET_DATE that are aggressively changing built form based on underlying data (basing on discriminators)
Hi,
have you ever need to add different types of forms based on provided document type? I'm trying to achieve something like collection behavior with all allow add , allow delete functionality, but with my own form types, so I can't settle with generated ones.
Thank for any advice
The text was updated successfully, but these errors were encountered: