Symfony News

New in Symfony 4.3: Deprecated the Templating component integration

Kévin Dunglas Fabien Potencier

Contributed by Kévin Dunglas and Fabien Potencier in #21035.

The Symfony Templating component provides the tools needed to build any kind of template system, including the loading of template files from multiple sources, monitoring them for changes and using multiple engines to render them.

In Symfony applications this component allowed using both PHP and Twig to create the templates. However, nearly all developers use Twig to create traditional templates or use the serializer to output data. That's why in Symfony 4.3 we've decided to deprecate the integration of the Templating component in Symfony applications.

This means that, starting from Symfony 5.0, we will remove support for using PHP templates and PHP form themes. You'll need to use Twig for those templates. In addition to deprecating several classes, services and service tags, the hinclude_default_template configuration option has been moved to the fragments section:

# config/packages/framework.yaml
    # ...
-    templating:
+    fragments:
        hinclude_default_template: hinclude.html.twig

Although the number of people using PHP templates in Symfony applications is minimal compared to Twig, if enough people would volunteer to work on an alternative solution, we'd consider the creation of a new PHPTemplateBundle that provides all the deprecated classes and support files. If you are willing to help, create an issue in the main Symfony GitHub repository to kick off the discussion around this.

Be trained by Symfony experts - 2019-05-2 Clichy - 2019-05-13 Cologne - 2019-05-13 Clichy

About us

What a Symfony developer should know about the framework: News, Jobs, Tweets, Events, Videos,...

Find us on Twitter

Find us on Facebook