Add {% hyphenate %} ... {% endhyphenate %} tag #6

Closed
Carpetsmoker opened this Issue Sep 12, 2011 · 4 comments

3 participants

@Carpetsmoker

I wrote an extension that also adds a tag, a filter isn't that useful for most pages IMHO.

https://github.com/Carpetsmoker/Org_Heigl_Hyphenator/blob/master/extensions/TwigHyphenate.php

If you use my fork of Org_Heigl_Hyphenator (https://github.com/Carpetsmoker/Org_Heigl_Hyphenator) you can just put {% hyphenate %} ... {% endhyphenate %} around your entire HTML page.

(This is more of a comment and not really an "issue", I figured you might want to know about it and save some duplicate work)...

@stof

Twig already supports applying a filter to a whole block:

{% filter hyphenate %}
...
{% endfilter %}

And a filter is the best way according to the semantic of Twig. The hyphenator modifies the value which is the role of a filter. A tag is about modifying the structure of a template

@lsmith77
Liip member

in that case i am closing the ticket ..

@lsmith77 lsmith77 closed this Sep 12, 2011
@Carpetsmoker

I wasn't aware of the "{% filter hyphenate %}" construct :-) Thanks for pointing that out.

@lsmith77
Liip member

btw .. i just added an example to the README

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment