-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Improvements of the CollectionType Documentation #3338
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,17 +8,13 @@ choice is selected. | |
|
||
The true default value of this option depends on the field options: | ||
|
||
* If ``compound`` is ``true`` and ``data_class`` is set, then ``new $data_class()``; | ||
* If ``compound`` is ``true`` and no ``data_class`` is set, then ``array()``; | ||
* If ``compound`` is ``false``, then ``null``. | ||
* If ``required`` is ``true`` and ``data_class`` is set, then ``new $data_class()``; | ||
* If ``required`` is ``true`` and no ``data_class`` is set, then ``array()``; | ||
* If ``required`` is ``false``, then ``null``. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not 100% sure this is right, it looks to me (depending on the situation) that both Let me know what you see :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think @weaverryan is right. So, this part should be. But I'm not sure if we need a table with eight (each possible combination of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think a table is the right choice here, just:
|
||
|
||
.. tip:: | ||
|
||
The ``compound`` option is set to ``true`` when the field actually represents | ||
a collection of fields (e.g. a form of fields). | ||
|
||
For example, if you want the ``gender`` field to be set to ``null`` when no | ||
value is selected, you can do it like this: | ||
But you can customize this to your needs. For example, if you want the ``gender`` field to be | ||
explicitly set to ``null`` when no value is selected, you can do it like this: | ||
|
||
.. code-block:: php | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rewrite this a bit: