Twig Extension, Symfony implementation for the json_decode function.
- Create the Twig\Extension directories within your bundle (in this case we are using the default AppBundle).
- Create JsonDecode.php class
- Tell the container to add the service by adding the new class to your services.yml
- Use the new filter in any twig file!
example.twig.html
{{ data|json_decode }}