Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit a2a2b28

Browse filesBrowse files
committed
minor #11231 Documented the deprecation of the Templating component (javiereguiluz)
This PR was squashed before being merged into the master branch (closes #11231). Discussion ---------- Documented the deprecation of the Templating component Documents symfony/symfony#21035 but there are some things I'm not sure about. Please, review. Commits ------- 57fadaf Documented the deprecation of the Templating component
2 parents a15a816 + 57fadaf commit a2a2b28
Copy full SHA for a2a2b28

File tree

5 files changed

+32
-50
lines changed
Filter options

5 files changed

+32
-50
lines changed

‎form/create_custom_field_type.rst

Copy file name to clipboardExpand all lines: form/create_custom_field_type.rst
-47Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,6 @@ link for details), create a ``shipping_widget`` block to handle this:
185185
rules). Further, the main config file should point to the custom form template
186186
so that it's used when rendering all forms.
187187

188-
When using Twig this is:
189-
190188
.. configuration-block::
191189

192190
.. code-block:: yaml
@@ -222,51 +220,6 @@ link for details), create a ``shipping_widget`` block to handle this:
222220
],
223221
]);
224222
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-
270223
Using the Field Type
271224
--------------------
272225

‎reference/configuration/framework.rst

Copy file name to clipboardExpand all lines: reference/configuration/framework.rst
+6Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1559,6 +1559,12 @@ resources
15591559

15601560
**type**: ``string[]`` **default**: ``['FrameworkBundle:Form']``
15611561

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+
15621568
A list of all resources for form theming in PHP. This setting is not required
15631569
if you're :ref:`using the Twig format for your themes <forms-theming-twig>`.
15641570

‎reference/dic_tags.rst

Copy file name to clipboardExpand all lines: reference/dic_tags.rst
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -794,6 +794,11 @@ templating.helper
794794

795795
**Purpose**: Make your service available in PHP templates
796796

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+
797802
To enable a custom template helper, add it as a regular service in one
798803
of your configuration, tag it with ``templating.helper`` and define an
799804
``alias`` attribute (the helper will be accessible via this alias in the

‎templating/PHP.rst

Copy file name to clipboardExpand all lines: templating/PHP.rst
+12Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@
44
How to Use PHP instead of Twig for Templates
55
============================================
66

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+
713
Symfony defaults to Twig for its template engine, but you can still use
814
plain PHP code if you want. Both templating engines are supported equally in
915
Symfony. Symfony adds some nice features on top of PHP to make writing
@@ -17,6 +23,12 @@ templates with PHP more powerful.
1723
Rendering PHP Templates
1824
-----------------------
1925

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+
2032
If you want to use the PHP templating engine, first install the templating component:
2133

2234
.. code-block:: terminal

‎templating/hinclude.rst

Copy file name to clipboardExpand all lines: templating/hinclude.rst
+9-3Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ in your application configuration:
6767
# config/packages/framework.yaml
6868
framework:
6969
# ...
70-
templating:
70+
fragments:
7171
hinclude_default_template: hinclude.html.twig
7272
7373
.. code-block:: xml
@@ -83,7 +83,7 @@ in your application configuration:
8383
8484
<!-- ... -->
8585
<framework:config>
86-
<framework:templating hinclude-default-template="hinclude.html.twig"/>
86+
<framework:fragments hinclude-default-template="hinclude.html.twig"/>
8787
</framework:config>
8888
</container>
8989
@@ -92,13 +92,19 @@ in your application configuration:
9292
// config/packages/framework.php
9393
$container->loadFromExtension('framework', [
9494
// ...
95-
'templating' => [
95+
'fragments' => [
9696
'hinclude_default_template' => [
9797
'hinclude.html.twig',
9898
],
9999
],
100100
]);
101101
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+
102108
You can define default templates per ``render()`` function (which will override
103109
any global default template that is defined):
104110

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.