11.. index ::
2- single: Forms; Fields; collection
2+ single: Forms; Fields; CollectionType
33
4- collection Field Type
5- =====================
4+ CollectionType Field
5+ ====================
66
77This field type is used to render a "collection" of some field or form.
8- In the easiest sense, it could be an array of ``text `` fields that populate
9- an array ``emails `` field . In more complex examples, you can embed entire
8+ In the easiest sense, it could be an array of ``TextType `` fields that populate
9+ an array ``emails `` values . In more complex examples, you can embed entire
1010forms, which is useful when creating forms that expose one-to-many
1111relationships (e.g. a product from where you can manage many related product
1212photos).
@@ -32,7 +32,7 @@ photos).
3232| | - `mapped `_ |
3333| | - `required `_ |
3434+-------------+-----------------------------------------------------------------------------+
35- | Parent type | :doc: `form </reference/forms/types/form >` |
35+ | Parent type | :doc: `FormType </reference/forms/types/form >` |
3636+-------------+-----------------------------------------------------------------------------+
3737| Class | :class: `Symfony\\ Component\\ Form\\ Extension\\ Core\\ Type\\ CollectionType ` |
3838+-------------+-----------------------------------------------------------------------------+
@@ -287,8 +287,8 @@ entry_options
287287**type **: ``array `` **default **: ``array() ``
288288
289289This is the array that's passed to the form type specified in the `entry_type `_
290- option. For example, if you used the :doc: `choice </reference/forms/types/choice >`
291- type as your `entry_type `_ option (e.g. for a collection of drop-down menus),
290+ option. For example, if you used the :doc: `ChoiceType </reference/forms/types/choice >`
291+ as your `entry_type `_ option (e.g. for a collection of drop-down menus),
292292then you'd need to at least pass the ``choices `` option to the underlying
293293type::
294294
@@ -317,9 +317,9 @@ entry_type
317317
318318**type **: ``string `` or :class: `Symfony\\ Component\\ Form\\ FormTypeInterface ` **required **
319319
320- This is the field type for each item in this collection (e.g. ``text ``,
321- ``choice ``, etc). For example, if you have an array of email addresses,
322- you'd use the :doc: `email </reference/forms/types/email >` type . If you want
320+ This is the field type for each item in this collection (e.g. ``TextType ``,
321+ ``ChoiceType ``, etc). For example, if you have an array of email addresses,
322+ you'd use the :doc: `EmailType </reference/forms/types/email >`. If you want
323323to embed a collection of some other form, create a new instance of your
324324form type and pass it as this option.
325325
@@ -374,9 +374,8 @@ not replaced with the same value.
374374Inherited Options
375375-----------------
376376
377- These options inherit from the :doc: `form </reference/forms/types/form >`
378- type. Not all options are listed here - only the most applicable to this
379- type:
377+ These options inherit from the :doc: `FormType </reference/forms/types/form >`.
378+ Not all options are listed here - only the most applicable to this type:
380379
381380.. _reference-form-types-by-reference :
382381
0 commit comments