0
votes

I'm trying to use ZF2 with the ZfcTwig module. I have basic structure from the Skeleton Application: view->layout->layout.phtml (or layout.twig) view->application->index->index.phtml (or index.twig)

if I use the next pair: layout.twig and index.phtml - layout.twig is rendered correctly by the ZfcTwig module, the result for index.phtml (default rendering) is correct also.

But if I try to use content template as a twig template (both twig files) - I'm getting only index.twig with correct render, but nothing from layout template (layout.twig or even layout.phtml)

Did anybody has the same situation?

1
Update: ZfcTwig module has the next option: 'disable_zf_model' => false This turns second layer rendering off. turning this on will change the situation, but I'm not sure that is the right way.Sergii

1 Answers

3
votes

You can use twig layouts, it works great with ZfcTwig

in index.twig

{% extends 'layout/layout.twig' %}

{% block content %}
    Here your template
{% endblock content %}

in layout.twig

{% block content %}{{ content|raw }}{% endblock content %}