diff --git a/form/create_custom_field_type.rst b/form/create_custom_field_type.rst
index 9023f0c9d40..b67c0a330d8 100644
--- a/form/create_custom_field_type.rst
+++ b/form/create_custom_field_type.rst
@@ -185,8 +185,6 @@ link for details), create a ``shipping_widget`` block to handle this:
rules). Further, the main config file should point to the custom form template
so that it's used when rendering all forms.
- When using Twig this is:
-
.. configuration-block::
.. code-block:: yaml
@@ -222,51 +220,6 @@ link for details), create a ``shipping_widget`` block to handle this:
],
]);
- For the PHP templating engine, your configuration should look like this:
-
- .. configuration-block::
-
- .. code-block:: yaml
-
- # config/packages/framework.yaml
- framework:
- templating:
- form:
- resources:
- - ':form:fields.html.php'
-
- .. code-block:: xml
-
-
-
-
-
-
-
-
- :form:fields.html.php
-
-
-
-
-
- .. code-block:: php
-
- // config/packages/framework.php
- $container->loadFromExtension('framework', [
- 'templating' => [
- 'form' => [
- 'resources' => [
- ':form:fields.html.php',
- ],
- ],
- ],
- ]);
-
Using the Field Type
--------------------
diff --git a/reference/configuration/framework.rst b/reference/configuration/framework.rst
index 0f54eecbf74..bae4ddbf899 100644
--- a/reference/configuration/framework.rst
+++ b/reference/configuration/framework.rst
@@ -1554,6 +1554,12 @@ resources
**type**: ``string[]`` **default**: ``['FrameworkBundle:Form']``
+.. deprecated:: 4.3
+
+ The integration of the Templating component in FrameworkBundle has been
+ deprecated since version 4.3 and will be removed in 5.0. Form theming with
+ PHP templates will no longer be supported and you'll need to use Twig instead.
+
A list of all resources for form theming in PHP. This setting is not required
if you're :ref:`using the Twig format for your themes `.
diff --git a/reference/dic_tags.rst b/reference/dic_tags.rst
index 1aca88bb444..5b8cacddeb5 100644
--- a/reference/dic_tags.rst
+++ b/reference/dic_tags.rst
@@ -794,6 +794,11 @@ templating.helper
**Purpose**: Make your service available in PHP templates
+.. deprecated:: 4.3
+
+ The ``templating.helper`` tag is deprecated since version 4.3 and will be
+ removed in 5.0; use Twig instead.
+
To enable a custom template helper, add it as a regular service in one
of your configuration, tag it with ``templating.helper`` and define an
``alias`` attribute (the helper will be accessible via this alias in the
diff --git a/templating/PHP.rst b/templating/PHP.rst
index bc9a0d61149..d0b218292b6 100644
--- a/templating/PHP.rst
+++ b/templating/PHP.rst
@@ -4,6 +4,12 @@
How to Use PHP instead of Twig for Templates
============================================
+.. deprecated:: 4.3
+
+ The integration of the Templating component in FrameworkBundle has been
+ deprecated since version 4.3 and will be removed in 5.0. PHP templates will
+ no longer be supported and you'll need to use Twig instead.
+
Symfony defaults to Twig for its template engine, but you can still use
plain PHP code if you want. Both templating engines are supported equally in
Symfony. Symfony adds some nice features on top of PHP to make writing
@@ -17,6 +23,12 @@ templates with PHP more powerful.
Rendering PHP Templates
-----------------------
+.. deprecated:: 4.3
+
+ The integration of the Templating component in FrameworkBundle has been
+ deprecated since version 4.3 and will be removed in 5.0. PHP templates will
+ no longer be supported and you'll need to use Twig instead.
+
If you want to use the PHP templating engine, first install the templating component:
.. code-block:: terminal
diff --git a/templating/hinclude.rst b/templating/hinclude.rst
index 675fd268607..396dec13643 100644
--- a/templating/hinclude.rst
+++ b/templating/hinclude.rst
@@ -67,7 +67,7 @@ in your application configuration:
# config/packages/framework.yaml
framework:
# ...
- templating:
+ fragments:
hinclude_default_template: hinclude.html.twig
.. code-block:: xml
@@ -83,7 +83,7 @@ in your application configuration:
-
+
@@ -92,13 +92,19 @@ in your application configuration:
// config/packages/framework.php
$container->loadFromExtension('framework', [
// ...
- 'templating' => [
+ 'fragments' => [
'hinclude_default_template' => [
'hinclude.html.twig',
],
],
]);
+.. versionadded:: 4.3
+
+ The ``framework.fragments.hinclude_default_template`` option was introduced
+ in Symfony 4.3. In previous Symfony versions it was called
+ ``framework.templating.hinclude_default_template``.
+
You can define default templates per ``render()`` function (which will override
any global default template that is defined):