OxCom / zf3-twig

ZendTwig is a module that integrates the Twig template engine with Laminas.
MIT License
19 stars 6 forks source link

Extends does not work #2

Closed HesyRa closed 7 years ago

HesyRa commented 7 years ago

Hi, The problem occured: if we use extends and {{content|raw}} in parent it renders the whole page instead of block content, if we don't include content|raw it doesn't render block at all Are we doing something wrong?

File: layout/layout.twig

{% block header %}{% endblock %}
<section class="container">
    <!-- Page content placeholder -->
    {% block content %}{% endblock %}
</section>
{% block footer %}{% endblock %}

File: application/index/index.twig

{% extends 'layout/layout.twig' %}
{% block header %}
test header
{% endblock %}

{% block content %}
test content
{% endblock %}
OxCom commented 7 years ago

In last release I have been added new option to the module: force_standalone

Also in this commit I added test for Your issue. So everything is fine.

As I understood correctly You should have this output:

test header
<section class="container">
    <!-- Page content placeholder -->
    test content
</section>

Sorry, If I misunderstood You. Thank You!

HesyRa commented 7 years ago

Sry, just updated to lates version and it works fine. sry.