Skip to content

osimek1/TwigExtraBundle

 
 

Repository files navigation

TwigExtraBundle

Build Status

##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)

About

Twig extra filters and extensions

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • PHP 100.0%