2017 © Pedro Peláez
 

library twig-strftime-extension

use strftime function in twig

image

teraone/twig-strftime-extension

use strftime function in twig

  • Monday, December 11, 2017
  • by teraone
  • Repository
  • 3 Watchers
  • 0 Stars
  • 10,512 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 5 Forks
  • 0 Open issues
  • 5 Versions
  • 9 % Grown

The README.md

Twig strftime Filter

Use strftime in twig, (*1)

{{ now|date_modify("+3 day")|strftime('%A') }} //-> Monday (if today is thursday at least :) )

{{ date()|strftime('%I:%M:%S %p') }} //-> Display the current time

{{ '2017-12-01'|strftime('%d %B %Y') }} //-> Accept string filtering (compatible with strtotime)

Installation

composer require teraone/twig-strftime-extension

Add the extension to your twig environment, (*2)

// set your locale
setlocale(LC_ALL, 'de_DE');
$twig->addExtension(new Teraone\Twig\Extension\StrftimeExtension());

// optional: set Timezone
$twig->getExtension('core')->setTimezone('Europe/Berlin');

For the full list of supported time formats have a look at the PHP strftime documentation, (*3)

The Versions

11/12 2017

dev-master

9999999-dev

use strftime function in twig

  Sources   Download

MIT

The Requires

 

The Development Requires

11/12 2017

1.2.0

1.2.0.0

use strftime function in twig

  Sources   Download

MIT

The Requires

 

The Development Requires

19/09 2017

1.1.1

1.1.1.0

use strftime function in twig

  Sources   Download

MIT

The Requires

 

The Development Requires

13/09 2017

1.1.0

1.1.0.0

use strftime function in twig

  Sources   Download

MIT

The Requires

 

The Development Requires

18/03 2016

1.0.1

1.0.1.0

use strftime function in twig

  Sources   Download

MIT

The Requires

 

The Development Requires