symfony-cmf/sonata-phpcr-admin-integration-bundle

FormTypes extraction

fbourigault opened this issue · 5 comments

Before admin classes were moved into this bundle, the idea was to extract reusable FormTypes from every admin class. Once those FormTypes are extracted, sonata admin classes may use it. This later step probably require sonata-project/SonataAdminBundle#4243 to be solved.

symfony-cmf/content-bundle#150 may be a good starting point to anyone who want help on this topic.

On Symfony-devs slack, we talked about relevancy of extracting form types. We agreed that extracting FormTypes will not be as profitable as expected because:

  • Every application/integration that would build a form type for one of our model will require something different. So, we will either provide a lot of option that will make form types over complicated or users will write lot of form event listeners. Overhead will make things too complicated.
  • In a general way, forms are not bound to entities/models but to actions.

As a conclusion, we thought our time will be more valuable if spent building FormTypeGuesser services.

dbu commented

agreed. we should remove the form type we already did from the ContentBundle and work on form type guessers in the bundles that provide something useful for forms. like the tree browser bundle. lets close this issue and create issues in the respective bundles - which ones could do that, anything else than the tree browser?

CmfContentBundle may provide a type guesser for the ckeditor form type, or we contribute it to the ckeditor bundle directly.

dbu commented

its in general a tricky business however, to know whether wysiwyg is appropriate or not

Yeah, I think it's should maybe be disabled by default. However, guessing always is tricky and if not correct, people just have to specify the form type name (it's not that hard).