File tree Expand file tree Collapse file tree 3 files changed +64
-6
lines changed Expand file tree Collapse file tree 3 files changed +64
-6
lines changed Original file line number Diff line number Diff line change @@ -133,8 +133,36 @@ Serializer
133
133
TwigBridge
134
134
----------
135
135
136
- * Deprecated the possibility to inject the Form Twig Renderer into the form
137
- extension. Inject it into the ` TwigRendererEngine ` instead.
136
+ * Injecting the Form ` TwigRenderer ` into the ` FormExtension ` is deprecated and has no more effect.
137
+ Upgrade Twig to ` ^1.30 ` , inject the ` Twig_Environment ` into the ` TwigRendererEngine ` and load
138
+ the ` TwigRenderer ` using the ` Twig_FactoryRuntimeLoader ` instead.
139
+
140
+ Before:
141
+
142
+ ``` php
143
+ use Symfony\Bridge\Twig\Extension\FormExtension;
144
+ use Symfony\Bridge\Twig\Form\TwigRenderer;
145
+ use Symfony\Bridge\Twig\Form\TwigRendererEngine;
146
+
147
+ // ...
148
+ $rendererEngine = new TwigRendererEngine(array('form_div_layout.html.twig'));
149
+ $rendererEngine->setEnvironment($twig);
150
+ $twig->addExtension(new FormExtension(new TwigRenderer($rendererEngine, $csrfTokenManager)));
151
+ ```
152
+
153
+ After:
154
+
155
+ ``` php
156
+ $rendererEngine = new TwigRendererEngine(array('form_div_layout.html.twig'), $twig);
157
+ $twig->addRuntimeLoader(new Twig_FactoryRuntimeLoader(array(
158
+ Renderer::class => function () use ($rendererEngine, $csrfTokenManager) {
159
+ return new TwigRenderer($rendererEngine, $csrfTokenManager);
160
+ },
161
+ )));
162
+ $twig->addExtension(new FormExtension());
163
+ ```
164
+
165
+ * Deprecated the ` TwigRendererEngineInterface ` interface, will be removed in 4.0.
138
166
139
167
Validator
140
168
---------
Original file line number Diff line number Diff line change @@ -186,8 +186,36 @@ Translation
186
186
TwigBridge
187
187
----------
188
188
189
- * The possibility to inject the Form Twig Renderer into the form extension
190
- has been removed. Inject it into the ` TwigRendererEngine ` instead.
189
+ * Removed the possibility to inject the Form ` TwigRenderer ` into the ` FormExtension ` .
190
+ Upgrade Twig to ` ^1.30 ` , inject the ` Twig_Enviro
8000
nment ` into the ` TwigRendererEngine ` and load
191
+ the ` TwigRenderer ` using the ` Twig_FactoryRuntimeLoader ` instead.
192
+
193
+ Before:
194
+
195
+ ``` php
196
+ use Symfony\Bridge\Twig\Extension\FormExtension;
197
+ use Symfony\Bridge\Twig\Form\TwigRenderer;
198
+ use Symfony\Bridge\Twig\Form\TwigRendererEngine;
199
+
200
+ // ...
201
+ $rendererEngine = new TwigRendererEngine(array('form_div_layout.html.twig'));
202
+ $rendererEngine->setEnvironment($twig);
203
+ $twig->addExtension(new FormExtension(new TwigRenderer($rendererEngine, $csrfTokenManager)));
204
+ ```
205
+
206
+ After:
207
+
208
+ ``` php
209
+ $rendererEngine = new TwigRendererEngine(array('form_div_layout.html.twig'), $twig);
210
+ $twig->addRuntimeLoader(new Twig_FactoryRuntimeLoader(array(
211
+ Renderer::class => function () use ($rendererEngine, $csrfTokenManager) {
212
+ return new TwigRenderer($rendererEngine, $csrfTokenManager);
213
+ },
214
+ )));
215
+ $twig->addExtension(new FormExtension());
216
+ ```
217
+
218
+ * Removed the ` TwigRendererEngineInterface ` interface.
191
219
192
220
Validator
193
221
---------
Original file line number Diff line number Diff line change @@ -5,8 +5,10 @@ CHANGELOG
5
5
-----
6
6
7
7
* added ` AppVariable::getToken() `
8
- * Deprecated the possibility to inject the Form Twig Renderer into the form
9
- extension. Inject it on TwigRendererEngine instead.
8
+ * [ BC BREAK] Deprecated the possibility to inject the Form ` TwigRenderer ` into the form extension.
9
+ Inject the ` Twig_Environment ` into the ` TwigRendererEngine ` and load the ` Twig_Renderer `
10
+ using the ` Twig_FactoryRuntimeLoader ` instead.
11
+ * Deprecated the ` TwigRendererEngineInterface ` interface.
10
12
11
13
2.7.0
12
14
-----
You can’t perform that action at this time.
0 commit comments