1

I am trying to build a simple backend application based on EasyAdmin. The ORM is Doctrine.

I have set up 3 entities : * Entity A has a unidirectional many-to-many relation to entity B * Entity B has a one-to-one relation to entity C * Entity C has some basic properties

In EasyAdmin I have set up the Entity A and Entity C. The purpose is to add/edit Entity B while adding/editing entity A. II found the following which is exactly what I want. symfony easyadmin one to many form.

But when I want to add an Entity B while adding Entity A, it creates a form with the appropriate fields but the form has its own save button. Which seems to conflict with the main save button. Results

Is there a working example of what I want to achieve or some documentation on how to do it ?

Regards

Christophe Absil

1 Answers1

0

I think that a good idea would be to override the 'new' and 'edit' templates. You have here the official documentation to help you.

While rendering the form, you will be able to hide/add labels & buttons; in order to hide a form element, just add:

 {{ form_end(form, {'render_rest': false}) }}

A final step would be to override EasyAdmin's AdminController in order to persist the second entity; this is the official page.

Good luck!

Luminita Balas
  • 604
  • 1
  • 5
  • 4