coduo / tutu-twig-extension
Adds new features to TuTu twig templates engine.
Installs: 20 585
Dependents: 3
Suggesters: 0
Security: 0
Stars: 0
Watchers: 4
Forks: 0
Open Issues: 0
Language:Cucumber
Type:project
Requires
- php: >=5.5.0
- twig/twig: 1.*
Requires (Dev)
- behat/behat: 3.0.*
- behat/mink-extension: ~2.0
- behat/mink-goutte-driver: ~1.0
- bossa/phpspec2-expect: ~1.0
- coduo/tutu: 1.0.*
- coduo/tutu-faker-extension: 1.0.*
This package is auto-updated.
Last update: 2024-11-20 07:59:29 UTC
README
This extensions adds new features to Twig
To use extension simply add it to TuTu composer dependencies:
$ composer require coduo/tutu-twig-extension
Enable extension in TuTu configuration
# config/config.yml
extensions:
Coduo\TuTu\Extension\Twig: ~
From now you should be able to use following features in twig:
Filters
json_decode
- decode json into array/object
Arguments
- $asArray - true
- $depth - 512
Examples
{% set user = request.content|json_decode %}
{
"id": 1,
"email": {{ user.name }}
}