asm89 / twig-cache-extension

The missing cache extension for Twig. Caching template fragments with Twig.
MIT License
388 stars 27 forks source link

wrapping multiple blocks in a child template #24

Closed sashn closed 8 years ago

sashn commented 9 years ago

WORKS:::

{% extends "base.html" %}

{% block title %}
    {% cache 'title' 3000 %}
        My title
    {% endcache %}
{% endblock %}

{% block content %}
    {% cache 'content' 3000 %}
        A lot of content
    {% endcache %}
{% endblock %}
...

DOESN'T WORK:::

{% extends "base.html" %}

{% cache 'allBlocks' 3000 %}
    {% block title %}
        My title
    {% endblock %}

    {% block content %}
        A lot of content
    {% endblock %}
{% endcache %}
...

what are we doing wrong?

asm89 commented 9 years ago

@sashn were you able to figure out what's going on in here? Can you create a minimal project/PHP file I can run to reproduce the problem?

asm89 commented 8 years ago

Closing due to inactivity. Feel free to re-open.