Is there a way to add multiple entries in symfony to database? I use ORM Doctrine and for example i want to create dynamic form:
Main form (Dish type):
Name
Description
Prep time
Variants (Variant type):
[
Add new variant: name (Add more, Delete)
]
With javascript support for adding multiple variants at once. For now i have default CRUD generated objects with ManyToOne connection between Dish and Variant therefore I don’t think I need to include that easy piece of code 🙂
I can create javascript but how to get form from the browser? Is there any example?
You can do it using form collection. See this cookbook entry.