Include a PHP file in a Twig template
Pergunta
I need to include a PHP script in my twig template. Is this possible?
Solução
You would not want to do that. What you can do is to create a twig extension and run your PHP code there. In your template you would just call your extension:
{{ myExtension() }}
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow