Symfony Bundle to keep using PHP templates
Symfony Bundle in order to keep using PHP template
This was not tested properly, use with caution
composer require nyrodev/php-template-bundle dev-master
As you did before on Symfony 4, simply use your php template when rendering something. Usage examples :
$this->render('Admin/template.html.php', /* ... */); $this->render('@MyBundle/Admin/template.html.php', /* ... */);
All helpers extings on Symfony 4 was also ported, like
It means you can still use them on your PHP templates with
Moreover, the tag
templating.helper is still working.
You can still define your own PHP template helper by simply adding this tag, just like before.
You can also implements the
NyroDev\PhpTemplateBundle\Helper\HelperInterface interface in order to be available from your view using the alias return by
PHP Form templates does NOT work.
It requires more works and it shouldn't be too much work to rewrite only these templates into Twig.
Many source code comes from the last version 4 of framework bundle. For now, the only changes made on these files have been removing deprecation notices and changing namespaces.