A simple twig extension to provide json encode and decode filters and functions for Twig.
Requirements:
"require": {
"bearlikelion/twig-jsontools": "dev-master",
}
$twig = new Twig_Environment(new Twig_Loader_Filesystem('Views'));
$twig->addExtension(new Bearlikelion\TwigJsonTools\Extension);
<html>
<body>
{{ json_decode(json.object) }}
</body>
</html>