Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork5.3k
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
yceruto commentedJul 5, 2018
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 theFormView has a publicparent property. The problem appears when you have also defined aparent 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 forform.parent could change depending on whether your form has or not aparent field. If no: you're checking the parent view, if yes: you're checking the parent field
yceruto commentedJul 6, 2018
Perfect, thank you! |
javiereguiluz commentedJul 6, 2018
Yonel, thanks for implementing this feature and for providing the docs for it! |
HeahDude left a comment
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 in640e8e5
* 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 PRsymfony/symfony#25236 andcloses#8829, sorry for the delay.