Skip to content

Latest commit

 

History

History
20 lines (15 loc) · 331 Bytes

README.md

File metadata and controls

20 lines (15 loc) · 331 Bytes

Installation

composer require ivovalchev/twig-truncate-html

And add it to your services.yaml:

    app.twig_extension:
        class: IvoValchev\TruncateHtmlExtension\TruncateHtmlExtension
        tags:
            - { name: twig.extension }

How to use

{{ "<p>hello world</p>"|truncate_html(5) }}