I'm trying to consolidate my form processing by entity_type, without rebuilding the forms (just using the default forms provided by Drupal.
I have dynamic routes pointing to a _controller::method. I've tried:
\Drupal::service('entity.form_builder')->getForm($group_content, 'edit', $data)but this just returns a render array, no instance.
\Drupal::formBuilder()->getForm('\Drupal\group\Entity\Form\GroupContentForm')but this is the wrong class path and i can't figure out how I could reference any entity:bundle:id by any pattern (i've tried many)
- C. Changed the route to use
FormBase(instead of a controller), but it seems these require the
buildFormmethod to defined the form's full field list (which defeats the purpose of my question).
What is the best approach to expose edit/add/delete process handlers for multiple bundles / entity_type in a single class?