Skip to content
This repository has been archived by the owner on Oct 30, 2022. It is now read-only.

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

rmonteil/twig-age-extension

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 

Repository files navigation

twig-age-extension

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 }}

About

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

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%