flatten icon indicating copy to clipboard operation
flatten copied to clipboard

Twig Support

Open dtaub opened this issue 10 years ago • 5 comments

Hi,

I'm working on Twig Support for Flatten and just wanted to make sure first that that feature doesn't already exist and that there isn't some reason why it hasn't been implemented.

Basing off the Blade example in the readme, it would look like this in Twig:

{% cache('articles', 10) %}
    {% for article in articles %}
        {{ article.name }}
    {% endfor %}
{% endcache %}

dtaub avatar Jun 17 '14 02:06 dtaub

You're correct it doesn't exist yet, the reason it wasn't implemented is I'm not really familiar with Twig extensions and left it out for now. If you want to PR it I'll gladly merge it :)

Anahkiasen avatar Jun 17 '14 07:06 Anahkiasen

Yes, Twig extensions (especially tags) are a little trickier than Blade; it took a couple hours looking through the code to figure it out. I have it more or less working but it's a bit hacked together at the moment so I just need to clean it up and figure out how to write some tests for it.

dtaub avatar Jun 20 '14 23:06 dtaub

@dtaub any progress on it? I need that feature too!

vkbansal avatar Jan 28 '15 09:01 vkbansal

@vkbansal I didn't forget about it but I haven't gotten around to cleaning it up and testing it. I do still use Twig regularly, though, so I'll try my best to finish it soon and send a PR, but I can't necessarily make any promises on timing.

dtaub avatar Feb 06 '15 21:02 dtaub

@dtaub I can help you out with testing it.

vkbansal avatar Feb 07 '15 03:02 vkbansal