1
1
.. index ::
2
- single: Forms; Fields; collection
2
+ single: Forms; Fields; CollectionType
3
3
4
- collection Field Type
5
- =====================
4
+ CollectionType Field
5
+ ====================
6
6
7
7
This 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
10
10
forms, which is useful when creating forms that expose one-to-many
11
11
relationships (e.g. a product from where you can manage many related product
12
12
photos).
@@ -32,7 +32,7 @@ photos).
32
32
| | - `mapped `_ |
33
33
| | - `required `_ |
34
34
+-------------+-----------------------------------------------------------------------------+
35
- | Parent type | :doc: `form </reference/forms/types/form >` |
35
+ | Parent type | :doc: `FormType </reference/forms/types/form >` |
36
36
+-------------+-----------------------------------------------------------------------------+
37
37
| Class | :class: `Symfony\\ Component\\ Form\\ Extension\\ Core\\ Type\\ CollectionType ` |
38
38
+-------------+-----------------------------------------------------------------------------+
@@ -287,8 +287,8 @@ entry_options
287
287
**type **: ``array `` **default **: ``array() ``
288
288
289
289
This 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),
292
292
then you'd need to at least pass the ``choices `` option to the underlying
293
293
type::
294
294
@@ -317,9 +317,9 @@ entry_type
317
317
318
318
**type **: ``string `` or :class: `Symfony\\ Component\\ Form\\ FormTypeInterface ` **required **
319
319
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
323
323
to embed a collection of some other form, create a new instance of your
324
324
form type and pass it as this option.
325
325
@@ -374,9 +374,8 @@ not replaced with the same value.
374
374
Inherited Options
375
375
-----------------
376
376
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:
380
379
381
380
.. _reference-form-types-by-reference :
382
381
0 commit comments