Jeroen
Jeroen

Reputation: 3419

How to call a php template from a twig template

I have two template files. One is a twig template and another is a php template file. Rendering both directly from the controller works, but when I want to render de php template inside the twig template using the {% include 'mytemplate.html.php' %} but then Symfony uses Twig to parse the template, not the php template engine.

How do I tell Twig to render the template file as a php template instead of a Twig template?

Upvotes: 2

Views: 979

Answers (1)

galymzhan
galymzhan

Reputation: 5523

You'll have to write an extension for Twig. The extension could provide function which will take PHP template name as an argument and will render it. Why are you using two different templating engines?

Upvotes: 3

Related Questions