-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
[Form] Document CollectionType's prototype_data option #4367
Conversation
kgilden
commented
Oct 24, 2014
Q | A |
---|---|
Doc fix? | no |
New docs? | yes (PR symfony/symfony#12314) |
Applies to | 2.8+ |
Fixed tickets | - |
prototype_data
prototype_data
prototype_data
…(kgilden) This PR was submitted for the master branch but it was merged into the 2.8 branch instead (closes #12314). Discussion ---------- [Form] Add "prototype_data" option to collection type | Q | A | ------------- | --- | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #5095 | License | MIT | Doc PR | symfony/symfony-docs#4367 Makes it possible to have default data for collection prototypes. Commits ------- 80b0a80 [Form] Add "prototype_data" option to collection type
Alright @wouterj this should be ready for merging. Should I make a PR against 2.8 instead though? |
**type**: ``mixed`` **default**: ``null`` | ||
|
||
Allows you to specify data for the prototype. This is useful if you want to | ||
have the fields filled with some basic values. |
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.
A very minor suggestion: would it better to say ... some initial values.
instead of ... some basic values.
?
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 am wondering if everybody will actually understand how to use this option. Would it be more clear how to use it if added a sentence explaining that what you configure here will be passed to the data
option of the embedded type?
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.
Yeah, I like some initial values
better too. To address xabbuh's concerns - what about something along the lines of Each new row added will initially contain the data set by this option
?
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.
@kgilden i like the sentence with the row...
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 agree. That's a nice suggestion.
Any update on that? |
@kgilden can you finish this PR soon? |
5355d8b
to
8364f55
Compare
8364f55
to
6365f3a
Compare
@OskarStark @xabbuh updated the PR and rebased on top of master. Or should I rebase on top of 2.8 now that it exists? |
@kgilden as your PR targets the master branch, keep it based on the master branch to have a clean diff. The doc mergers will switch the target to 2.8 when merging. Rebasing it on 2.8 may cause some weird diff to appear here in case 2.8 is not fully merged into master. |
Status: Reviewed ping @xabbuh |
@kgilden thanks for providing this doc. Although your explanation is correct, I find it a bit lacking. Could you please add some real examples of this option in use? Thanks. |
ping @kgilden |
ping :) |
Also it should mention that the default value is the When ``null`` the default prototype data is the same as set in the ``_entry_options:`` option. |
…gilden, HeahDude) This PR was merged into the 2.8 branch. Discussion ---------- [Form] added prototype_data option in CollectionType | Q | A | |----|----| | Branch | 2.8+ | | New doc | finishes #4367 | Commits ------- 95bda57 [Form] defined default and added example CollectionType `prototype_data` option e18dc1f [Form] Document CollectionType's `prototype_data`