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

1.0.0 2016-11-20 17:21 UTC

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 }}
}