taavit/twig-extra-bundle

This bundles provides extra twig extensions and filter (DateTime prettifier)

Installs: 316

Dependents: 0

Suggesters: 0

Security: 0

Stars: 3

Watchers: 5

Forks: 2

Open Issues: 5

Type:symfony-bundle

0.1.0 2013-08-08 08:59 UTC

This package is not auto-updated.

Last update: 2024-04-13 10:49:37 UTC


README

Build Status Scrutinizer Quality Score

##Installation via composer Update your composer.json

{
   "require":
     {
       "taavit/TwigExtraBundle": "dev-master"
     }
}

composer.phar update taavit/TwigExtraBundle

Update your AppKernel.php

public function registerBundles()
{
    return array(
        // ...
        new Taavit\TwigExtraBundle\TwigExtraBundle(),
        // ...
    );
}

##Usage

To your DateTime object in twig (created,updated) you simply add '|prettify'. Example:

{{comment.created|prettify}} 

and you will get nice formated when comment was added (5 days ago, yesterday, One year ago)