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-03-23 20:42:25 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>