genstor/twig-age-extension

This package is abandoned and no longer maintained. No replacement package was suggested.

Simple Twig extension to calculate the age in years based on a DateTime instance or a simple string

Installs: 4 087

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 1

Forks: 1

Open Issues: 0

pkg:composer/genstor/twig-age-extension

1.0.4 2016-12-26 16:47 UTC

This package is not auto-updated.

Last update: 2022-11-12 09:38:54 UTC


README

Simple Twig extension to calculate the age in years based on a DateTime instance or a string

Installation

Install via composer:

composer require genstor/twig-age-extension:@dev

Add the following to your services.yml file:

services:
    twig.extension.date:
        class: Genstor\Twig\AgeExtension
        tags:
            - { name: twig.extension }

Usage

{{ user.birthdate | age }}