Displaying an entity and associated entities in a table, with modification forms

ساخت وبلاگ

Vote count: 0

I have an entity which has some number of associated entities that I must show to the user in row form each, with other data such as the associated entity's name, cost, etc. I need the user to be able to modify the quantity.

I'm displaying the table in twig, and have a FormType that shows its associated entities in a CollectionType, but cannot for the life of me figure out how to do something like this:

{{ form_row(form.child[ entity.getId ]) }}

So that the quantity edit forms can appear in their corresponding table cell and not just sit on the top of the page. Should I render the entire table using a form? In that case, I have the difficulty of then integrating additional forms e.g. delete, and also I have just read that this is discouraged.

At the same time, Twig has next to no array support, so my other solution, which would be to store each associated form in an array indexed by ID, can't be made to work either.

asked 39 secs ago

back soft...
ما را در سایت back soft دنبال می کنید

برچسب : نویسنده : استخدام کار backsoft بازدید : 349 تاريخ : دوشنبه 31 خرداد 1395 ساعت: 19:39