1
votes

In my php template (mytemplate.html.php) I have

$view->extend('::base.html.twig');

$view['slots']->start('content');
...

I run the site, but I don't see any result except for this code:

{% extends app.request.xmlHttpRequest ? '::ajax-layout.html.twig' : '::page-layout.html.twig' %} {% block content %} {{ content|raw }} {% endblock %}

This is source of ::base.html.twig; Why isn't the result parsed ?

Is allowed to extend twig template in php template ? I need to push php template but others is twig.

When I comment:

//$view->extend('::base.html.twig');
//$view['slots']->start('content');

I see the results of php template.

1
If your using PHP templates shouldn't they be named ***.html.php?Jay Bhatt
i update code - this template have html.php and try extends twig template so base is html.twigDeveloper

1 Answers

4
votes

Twig and PHP templates are not compatible. You can't extend one from the other.