bearlikelion/twig-jsontools

A Twig extension to encode and decode json.

1.0.0 2014-08-27 14:41 UTC

This package is auto-updated.

Last update: 2024-12-23 22:16:19 UTC


README

A simple twig extension to provide json encode and decode filters and functions for Twig.

Requirements:

Installation

"require": {
	"bearlikelion/twig-jsontools": "dev-master",
}

Example

$twig = new \Twig\Environment(new \Twig\Loader\FilesystemLoader('Views'));
$twig->addExtension(new Bearlikelion\TwigJsonTools\Extension());
<html>
	<body>
		{{ json_decode(json.object) }}
	</body>
</html>