A
A
ak_wi2020-07-18 11:15:39
symfony
ak_wi, 2020-07-18 11:15:39

How to save a collection with respect to sorting?

What type of field is suitable so that you can save an array with TextType::class, taking into account the selected order in the form? If you save just an array, the elements are arranged randomly

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry, 2020-07-18
@ak_wi

If I understand your question correctly, then in the child entity (for which you use TextType::class in the form), you can make an additional field like position, then sort these child entities by it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question