zenstruck / string-twig
This package is abandoned and no longer maintained.
The author suggests using the zenstruck/string package instead.
Twig integration for zenstruck/string.
v2.0.0
2016-12-06 21:09 UTC
Requires
- twig/twig: ^1.12
- zenstruck/string: ^2.0
README
Twig integration for zenstruck/string.
Installation
composer require zenstruck/string-twig
Manual Setup
See the Twig documentation for more information
use Zenstruck\String\Bridge\Twig\StringExtension; $twig->addExtension(new StringExtension());
Add to a Symfony Project
Add to your config.yml
:
services: zenstruck.string.twig_extension: class: Zenstruck\String\Bridge\Twig\StringExtension public: false tags: - { name: twig.extension }
Usage
For full function documentation, see zenstruck\string.
{{ remove_whitespace(' foo bar') }} {# 'foo bar' #} {{ null_trim(' ') }} {# null #} {{ truncate_word(' foo bar baz', 10) }} {# 'foo bar..' #}