]> git.immae.eu Git - github/wallabag/wallabag.git/blob - vendor/twig/twig/doc/filters/json_encode.rst
twig implementation
[github/wallabag/wallabag.git] / vendor / twig / twig / doc / filters / json_encode.rst
1 ``json_encode``
2 ===============
3
4 The ``json_encode`` filter returns the JSON representation of a string:
5
6 .. code-block:: jinja
7
8 {{ data|json_encode() }}
9
10 .. note::
11
12 Internally, Twig uses the PHP `json_encode`_ function.
13
14 Arguments
15 ---------
16
17 * ``options``: A bitmask of `json_encode options`_ (``{{
18 data|json_encode(constant(JSON_PRETTY_PRINT)) }}``)
19
20 .. _`json_encode`: http://php.net/json_encode
21 .. _`json_encode options`: http://www.php.net/manual/en/json.constants.php