-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[Form] Compound option explained #9283
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
Conversation
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 like this change, but I find this description confusing:
The compound option determines whether a form can have children,
in other words is a parent form for other forms.
I don't think both descriptions are equivalent: "can have children" vs "is the parent of other forms". In pseudo-code this would be like canHaveChildren()
vs hasChildren()
. Both methods are not equivalent. So, what's the most precise description of compound form
?
@javiereguiluz I think that's more due to non-nativeness. In the second statement, "is" should be "may" or "can be": In other words, can be a parent form for other forms. |
Yes, agree, I will fix this. We also discussed a couple of corrections with @HeahDude, I hope to commit them today. |
@vudaltsov could you please finish this PR? I'd love to merge it. Thanks! |
@javiereguiluz , does it look better now? |
Non-compound forms are always leaves in a form tree, they cannot have children. | ||
|
||
A non-compound form is rendered as one of the html form elements: ``<input>`` | ||
(``TextType``, ``FileType``, ``HiddenType``), ``<textarea>`` (``TextareType``) |
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.
typo: TextareaType
This option specifies if a form is compound. This is independent of whether | ||
the form actually has children. A form can be compound but not have any | ||
children at all (e.g. an empty collection form). | ||
The compound option determines whether a form is compound. |
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.
This first phrase looks like a case of circular definition. I think it's better to merge these first phrases into one:
The compound option determines whether a form is compound.
Compound forms are structural elements in a form tree.
Only a compound form can have children, in other words can be a parent for other forms.
Something like this:
If ``true`` this option creates the form as "compound", meaning that it
can contain children and be a parent of other forms.
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.
In the introduction to this option I miss some comment about when you should (or should not) set this option to true
. In other words, Why/when is this option useful for end-users? Thanks!
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.
Ok, agree with your comments, hope to find time soon!
@javiereguiluz , I feel like I am ready to write an article about this option. Ahahah |
@vudaltsov thanks for your work on this. After your last changes, even I can fully understand what this option means and why/when should I use it. Thanks! |
This PR was squashed before being merged into the 3.4 branch (closes #10749). Discussion ---------- [Forms] Improved compound option description #SymfonyConHackday2018 Corrections for #9283. Thanx a lot to @HeahDude and @javiereguiluz ! Commits ------- 12e9334 [Forms] Improved compound option description
Closes #5213
ping @HeahDude , @wouterj , @xabbuh