8000 feature #5456 Completely re-reading the data transformers chapter (we… · symfony/symfony-docs@4abc22c · GitHub
[go: up one dir, main page]

Skip to content

Commit 4abc22c

Browse files
committed
feature #5456 Completely re-reading the data transformers chapter (weaverryan)
This PR was merged into the 2.3 branch. Discussion ---------- Completely re-reading the data transformers chapter | Q | A | ------------- | --- | Doc fix? | yes | New docs? | no | Applies to | 2.3+ | Fixed tickets | #5307 **Note**: `setDefaultOptions()` -> `configureOptions()` in 2.7 after merge Hi guys! This follows after #5307, which helped update the article (but also added some new complexity). Data transformers are super cool, but I think we've over-complicated them in the past. Even for me, before re-writing this, I tried to avoid transformers because I thought they were hard :). The code for this can be found here: https://github.com/weaverryan/docs-data-transformer/commits/finish, where each commit that starts with "[tuts-apply-diff]" is a "step" in the tutorial. My goals: 1) Show an easy example using the CallbackTransformer in the beginning 2) Remove complexity related to any factories that were there before 3) Moved theoretical section to the bottom Thanks! Commits ------- 0762848 Adding an example of how the other format for attaching transformers looks 28d7f89 fixed typo thanks to @OskarStark 41bb907 adding use statement 1514fdd using the aliases entity manager service name 9be07f0 Many tweaks thanks to review b48feda Completely re-reading the data transformers chapter:
2 parents fea061f + 0762848 commit 4abc22c

File tree

2 files changed

+288
-258
lines changed

2 files changed

+288
-258
lines changed

book/forms.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1141,6 +1141,8 @@ the choice is ultimately up to you.
11411141

11421142
$form->get('dueDate')->setData(new \DateTime());
11431143

1144+
.. _form-as-services:
1145+
11441146
Defining your Forms as Services
11451147
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
11461148

0 commit comments

Comments
 (0)
0