You are browsing the Symfony 4 documentation, which changes significantly from Symfony 3.x. If your app doesn't use Symfony 4 yet, browse the Symfony 3.4 documentation.

How to Use PHP instead of Twig for Templates

4.4 version

How to Use PHP instead of Twig for Templates

Caution

Starting from Symfony 5.0, PHP templates are no longer supported. Use Twig instead to create your templates.

This work, including the code samples, is licensed under a Creative Commons BY-SA 3.0 license.