bearlikelion/twig-timetools

A Twig extension to convert timestamps to readable seconds ago.

1.0.0 2014-08-27 17:11 UTC

This package is auto-updated.

Last update: 2024-11-27 04:36:35 UTC


README

A simple twig extension to provide a filter for ago to convert timestamps to readable X minutes ago.

Requirements:

Installation

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

Example

$twig = new Twig_Environment(new Twig_Loader_Filesystem('Views'));
$twig->addExtension(new Bearlikelion\TwigTimeTools\Extension);
<html>
	<body>
		{{ timestamp|ago }}
	</body>
</html>