softspring / time-ago-bundle
This bundle provides a simple twig extension to human readable date diff based on translations
Installs: 9 543
Dependents: 1
Suggesters: 0
Security: 0
Stars: 1
Watchers: 3
Forks: 0
Open Issues: 1
Type:symfony-bundle
Requires
- php: >=8.1
Requires (Dev)
- friendsofphp/php-cs-fixer: 3.64.*
- phpstan/phpstan: ^1.10
- rector/rector: ^1.0
- symfony/config: ^5.4|^6.0|^7.0
- symfony/dependency-injection: ^5.4|^6.0|^7.0
- symfony/http-kernel: ^5.4|^6.0|^7.0
- symfony/translation: ^5.4|^6.0|^7.0
- twig/twig: *
- 5.4.x-dev
- 5.3.x-dev
- v5.3.11
- v5.3.10
- v5.3.9
- v5.3.8
- v5.3.7
- v5.3.6
- v5.3.5
- v5.3.4
- v5.3.3
- v5.3.2
- v5.3.1
- v5.3.0
- v5.3.0-rc9
- v5.3.0-rc8
- v5.3.0-rc7
- v5.3.0-rc6
- v5.3.0-rc5
- v5.3.0-rc4
- v5.3.0-rc3
- v5.3.0-rc2
- v5.3.0-rc1
- v5.3.0-beta4
- v5.3.0-beta3
- v5.3.0-beta2
- v5.3.0-beta1
- v5.3.0-alpha21
- 5.2.x-dev
- v5.2.7
- v5.2.6
- v5.2.5
- v5.2.4
- v5.2.3
- v5.2.2
- v5.2.1
- v5.2.0
- v5.2.0-rc10
- v5.2.0-rc9
- v5.2.0-rc8
- v5.2.0-rc7
- v5.2.0-rc6
- v5.2.0-rc5
- v5.2.0-rc4
- v5.2.0-rc1
- 5.1.x-dev
- v5.1.25
- v5.1.24
- v5.1.23
- v5.1.22
- v5.1.21
- v5.1.20
- v5.1.19
- v5.1.18
- v5.1.17
- v5.1.16
- v5.1.15
- v5.1.14
- v5.1.13
- v5.1.12
- v5.1.11
- v5.1.10
- v5.1.9
- v5.1.8
- v5.1.7
- v5.1.6
- v5.1.5
- v5.1.2
- v5.1.1
- v5.1.0
- v5.0.6
- v5.0.5
- v5.0.4
- v5.0.3
- v5.0.2
- v5.0.1
- v5.0.0
- v5.0.0-rc1
- v5.0.0-beta1
- v5.0.0-alpha4
- v5.0.0-alpha3
- v5.0.0-alpha2
- v5.0.0-alpha1
- 4.1.0
- 4.0.0
- v1.0.2
- v1.0.1
- v1.0.0
- dev-dependabot/composer/friendsofphp/php-cs-fixer-3.65.star
This package is auto-updated.
Last update: 2024-12-19 09:28:28 UTC
README
This bundle provides a simple twig extension to human readable date diff based on translations.
Installation
Applications that use Symfony Flex
Open a command console, enter your project directory and execute:
$ composer require softspring/time-ago-bundle
Applications that don't use Symfony Flex
Step 1: Download the Bundle
Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:
$ composer require softspring/time-ago-bundle
This command requires you to have Composer installed globally, as explained in the installation chapter of the Composer documentation.
Step 2: Enable the Bundle
Then, enable the bundle by adding it to the list of registered bundles
in the app/AppKernel.php
file of your project:
<?php // app/AppKernel.php // ... class AppKernel extends Kernel { public function registerBundles() { $bundles = array( // ... new Softspring\TimeAgoBundle\SfsTimeAgoBundle(), ); // ... } // ... }
Usage
{{ object.createdAt|time_ago }} {# for example, renders: 5 minutes ago #}