Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / vendor / twig / twig / doc / filters / json_encode.rst
1 ``json_encode``
2 ===============
3
4 The ``json_encode`` filter returns the JSON representation of a value:
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`: https://secure.php.net/json_encode
21 .. _`json_encode options`: https://secure.php.net/manual/en/json.constants.php