Skip to content

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

License

Notifications You must be signed in to change notification settings

guzzlefry/twig-age-extension

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

twig-age-extension

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

Installation

Install via composer:

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

Add the following to your services.yml file:

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

Usage

{{ user.birthdate | age }}

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages