Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Form] fixed CollectionType options#6488

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
Closed
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 21 additions & 21 deletionsreference/forms/types/collection.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -12,15 +12,15 @@ relationships (e.g. a product from where you can manage many related product
photos).

+-------------+-----------------------------------------------------------------------------+
| Rendered as | depends on the `entry_type`_ option |
| Rendered as | depends on the `type`_ option |
+-------------+-----------------------------------------------------------------------------+
| Options | - `allow_add`_ |
| | - `allow_delete`_ |
| | - `delete_empty`_ |
| | - `entry_options`_ |
| | - `entry_type`_ |
| | - `options`_ |
| | - `prototype`_ |
| | - `prototype_name`_ |
| | - `type`_ |
+-------------+-----------------------------------------------------------------------------+
| Inherited | - `by_reference`_ |
| options | - `empty_data`_ |
Expand DownExpand Up@@ -276,8 +276,8 @@ form you have to set this option to true. However, existing collection entries
will only be deleted if you have the allow_delete_ option enabled. Otherwise
the empty values will be kept.

entry_options
~~~~~~~~~~~~~
options
~~~~~~~

**type**: ``array`` **default**: ``array()``

Expand All@@ -292,28 +292,17 @@ type::
// ...

$builder->add('favorite_cities', CollectionType::class, array(
'entry_type' =>ChoiceType::class,
'entry_type' =>'choice,
'entry_options' => array(
'choices' => array(
'Nashville' => 'nashville',
'Paris' => 'paris',
'Berlin' => 'berlin',
'London' => 'london',
'nashville' => 'Nashville',
'paris' => 'Paris',
'berlin' => 'Berlin',
'london' => 'London',
),
),
));

entry_type
~~~~~~~~~~

**type**: ``string`` or :class:`Symfony\\Component\\Form\\FormTypeInterface` **required**

This is the field type for each item in this collection (e.g. ``TextType``,
``ChoiceType``, etc). For example, if you have an array of email addresses,
you'd use the :doc:`EmailType </reference/forms/types/email>`. If you want
to embed a collection of some other form, create a new instance of your
form type and pass it as this option.

prototype
~~~~~~~~~

Expand DownExpand Up@@ -362,6 +351,17 @@ If you have several collections in your form, or worse, nested collections
you may want to change the placeholder so that unrelated placeholders are
not replaced with the same value.

type
~~~~

**type**: ``string`` or :class:`Symfony\\Component\\Form\\FormTypeInterface` **required**

This is the field type for each item in this collection (e.g. ``TextType``,
``ChoiceType``, etc). For example, if you have an array of email addresses,
you'd use the :doc:`EmailType </reference/forms/types/email>`. If you want
to embed a collection of some other form, create a new instance of your
form type and pass it as this option.

Inherited Options
-----------------

Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp