File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -229,6 +229,23 @@ you'd use the :doc:`EmailType </reference/forms/types/email>`. If you want
229
229
to embed a collection of some other form, pass the form type class as this
230
230
option (e.g. ``MyFormType::class ``).
231
231
232
+ keep_as_list
233
+ ~~~~~~~~~~~~
234
+
235
+ **type **: ``boolean `` **default **: ``false ``
236
+
237
+ If set to ``true ``, the entries will be reindexed so their indexes follow each
238
+ other. This is useful when you validate a collection type and an item was
239
+ removed from the collection on submit. If you don't reindex the entries, the
240
+ indexes may have gaps in them. For example, if you have a collection of 3
241
+ items and you remove the second item, the indexes will be ``0 `` and ``2 `` when
242
+ validating the collection. If you reindex the entries by setting the option
243
+ to ``true ``, the indexes will be ``0 `` and ``1 ``.
244
+
245
+ .. versionadded :: 7.1
246
+
247
+ The ``keep_as_list `` option was introduced in Symfony 7.1.
248
+
232
249
prototype
233
250
~~~~~~~~~
234
251
You can’t perform that action at this time.
0 commit comments