File tree 5 files changed +32
-50
lines changed
Filter options
5 files changed +32
-50
lines changed
Original file line number Diff line number Diff line change @@ -185,8 +185,6 @@ link for details), create a ``shipping_widget`` block to handle this:
185
185
rules). Further, the main config file should point to the custom form template
186
186
so that it's used when rendering all forms.
187
187
188
- When using Twig this is:
189
-
190
188
.. configuration-block ::
191
189
192
190
.. code-block :: yaml
@@ -222,51 +220,6 @@ link for details), create a ``shipping_widget`` block to handle this:
222
220
],
223
221
]);
224
222
225
- For the PHP templating engine, your configuration should look like this:
226
-
227
- .. configuration-block ::
228
-
229
- .. code-block :: yaml
230
-
231
- # config/packages/framework.yaml
232
- framework :
233
- templating :
234
- form :
235
- resources :
236
- - ' :form:fields.html.php'
237
-
238
- .. code-block :: xml
239
-
240
- <!-- config/packages/framework.xml -->
241
- <?xml version =" 1.0" encoding =" UTF-8" ?>
242
- <container xmlns =" http://symfony.com/schema/dic/services"
243
- xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
244
- xmlns : framework =" http://symfony.com/schema/dic/symfony"
245
- xsi : schemaLocation =" http://symfony.com/schema/dic/services https://symfony.com/schema/dic/services/services-1.0.xsd
246
- http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd" >
247
-
248
- <framework : config >
249
- <framework : templating >
250
- <framework : form >
251
- <framework : resource >:form:fields.html.php</twig : resource >
252
- </framework : form >
253
- </framework : templating >
254
- </framework : config >
255
- </container >
256
-
257
- .. code-block :: php
258
-
259
- // config/packages/framework.php
260
- $container->loadFromExtension('framework', [
261
- 'templating' => [
262
- 'form' => [
263
- 'resources' => [
264
- ':form:fields.html.php',
265
- ],
266
- ],
267
- ],
268
- ]);
269
-
270
223
Using the Field Type
271
224
--------------------
272
225
Original file line number Diff line number Diff line change @@ -1559,6 +1559,12 @@ resources
1559
1559
1560
1560
**type **: ``string[] `` **default **: ``['FrameworkBundle:Form'] ``
1561
1561
1562
+ .. deprecated :: 4.3
1563
+
1564
+ The integration of the Templating component in FrameworkBundle has been
1565
+ deprecated since version 4.3 and will be removed in 5.0. Form theming with
1566
+ PHP templates will no longer be supported and you'll need to use Twig instead.
1567
+
1562
1568
A list of all resources for form theming in PHP. This setting is not required
1563
1569
if you're :ref: `using the Twig format for your themes <forms-theming-twig >`.
1564
1570
Original file line number Diff line number Diff line change @@ -794,6 +794,11 @@ templating.helper
794
794
795
795
**Purpose **: Make your service available in PHP templates
796
796
797
+ .. deprecated :: 4.3
798
+
799
+ The ``templating.helper `` tag is deprecated since version 4.3 and will be
800
+ removed in 5.0; use Twig instead.
801
+
797
802
To enable a custom template helper, add it as a regular service in one
798
803
of your configuration, tag it with ``templating.helper `` and define an
799
804
``alias `` attribute (the helper will be accessible via this alias in the
Original file line number Diff line number Diff line change 4
4
How to Use PHP instead of Twig for Templates
5
5
============================================
6
6
7
+ .. deprecated :: 4.3
8
+
9
+ The integration of the Templating component in FrameworkBundle has been
10
+ deprecated since version 4.3 and will be removed in 5.0. PHP templates will
11
+ no longer be supported and you'll need to use Twig instead.
12
+
7
13
Symfony defaults to Twig for its template engine, but you can still use
8
14
plain PHP code if you want. Both templating engines are supported equally in
9
15
Symfony. Symfony adds some nice features on top of PHP to make writing
@@ -17,6 +23,12 @@ templates with PHP more powerful.
17
23
Rendering PHP Templates
18
24
-----------------------
19
25
26
+ .. deprecated :: 4.3
27
+
28
+ The integration of the Templating component in FrameworkBundle has been
29
+ deprecated since version 4.3 and will be removed in 5.0. PHP templates will
30
+ no longer be supported and you'll need to use Twig instead.
31
+
20
32
If you want to use the PHP templating engine, first install the templating component:
21
33
22
34
.. code-block :: terminal
Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ in your application configuration:
67
67
# config/packages/framework.yaml
68
68
framework :
69
69
# ...
70
- templating :
70
+ fragments :
71
71
hinclude_default_template : hinclude.html.twig
72
72
73
73
.. code-block :: xml
@@ -83,7 +83,7 @@ in your application configuration:
83
83
84
84
<!-- ... -->
85
85
<framework : config >
86
- <framework : templating hinclude-default-template =" hinclude.html.twig" />
86
+ <framework : fragments hinclude-default-template =" hinclude.html.twig" />
87
87
</framework : config >
88
88
</container >
89
89
@@ -92,13 +92,19 @@ in your application configuration:
92
92
// config/packages/framework.php
93
93
$container->loadFromExtension('framework', [
94
94
// ...
95
- 'templating ' => [
95
+ 'fragments ' => [
96
96
'hinclude_default_template' => [
97
97
'hinclude.html.twig',
98
98
],
99
99
],
100
100
]);
101
101
102
+ .. versionadded :: 4.3
103
+
104
+ The ``framework.fragments.hinclude_default_template `` option was introduced
105
+ in Symfony 4.3. In previous Symfony versions it was called
106
+ ``framework.templating.hinclude_default_template ``.
107
+
102
108
You can define default templates per ``render() `` function (which will override
103
109
any global default template that is defined):
104
110
You can’t perform that action at this time.
0 commit comments