-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Document Twig test "rootform" #10022
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
This is better now, gracias Javier 👍 |
reference/forms/twig_reference.rst
Outdated
|
||
.. code-block:: twig | ||
|
||
{# DON'T DO THIS: this code will fail when the form doesn't have a parent |
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 like to rephrase this sentence... since in no case this code will fail because the FormView
has a public parent
property. The problem appears when you have also defined a parent
form field. The last one will have priority for Twig due the array access ability.
I'm not sure how to explain it in short though.
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 mean... what you expect for form.parent
could change depending on whether your form has or not a parent
field. If no: you're checking the parent view, if yes: you're checking the parent field
Perfect, thank you! |
Yonel, thanks for implementing this feature and for providing the docs for it! |
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.
👍
.. code-block:: twig | ||
|
||
{# DON'T DO THIS: this simple check can't differentiate between a form having | ||
a parent form view and a form defining a normal form field called 'parent' #} |
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.
- normal
+ nested
?
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.
fixed in 640e8e5
* 3.4: Simplified the "Release Process" page [Workflow] Fix typo documentation Fix mismatched list items [symfony#9988] fix minor typos [symfony#10099] update XML and PHP config examples [symfony#9969] fix a minor typo [symfony#10022] fix a minor typo preUpdate Event Listener On Uploaded Imagery [symfony#10124] fix XML attribute name [symfony#10062] fix the code block [PHPUnitBridge] Explain how to show stack traces Fix docs on trusted hosts opcode optimizations
* 4.1: Simplified the "Release Process" page [Workflow] Fix typo documentation Fix mismatched list items typos in sample code [symfony#9988] fix minor typos [symfony#10099] update XML and PHP config examples [symfony#9969] fix a minor typo [symfony#10022] fix a minor typo preUpdate Event Listener On Uploaded Imagery [symfony#9757] fix rst syntax [symfony#10124] fix XML attribute name [symfony#10062] fix the code block [PHPUnitBridge] Explain how to show stack traces Fix docs on trusted hosts opcode optimizations
Documents PR symfony/symfony#25236 and closes #8829, sorry for the delay.