mareksokol/twig-jsontools

A Twig extension to encode and decode json.

2.0.0 2017-12-03 03:07 UTC

This package is not auto-updated.

Last update: 2024-04-10 06:32:24 UTC


README

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

Requirements:

Installation

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

Example

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