PHPackages                             jmf/twig-extensions-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Templating &amp; Views](/categories/templating)
4. /
5. jmf/twig-extensions-bundle

ActiveSymfony-bundle[Templating &amp; Views](/categories/templating)

jmf/twig-extensions-bundle
==========================

Collection of Twig extensions as a Symfony Bundle

1.1.0(4mo ago)0163mitPHPPHP ^8.0

Since Apr 7Pushed 4mo ago1 watchersCompare

[ Source](https://github.com/jmfeurprier/twig-extensions-bundle)[ Packagist](https://packagist.org/packages/jmf/twig-extensions-bundle)[ RSS](/packages/jmf-twig-extensions-bundle/feed)WikiDiscussions 1.0 Synced 1mo ago

READMEChangelogDependencies (13)Versions (4)Used By (0)

Twig extensions bundle
======================

[](#twig-extensions-bundle)

Collection of Twig extensions as a Symfony Bundle, which provides:

- array operations;
    - set/unset a specific array key (`array_set`, `array_unset`)
    - add a value to front/back of array (`array_push`, `array_unshift`)
    - remove a value from front/back of array (`array_pop`, `array_shift`)
- currency operations:
    - format a money amount (`amount|money_amount`)
- inlining operations:
    - dump the raw content of a file (`inline('style.css')`)
- sorting operations:
    - sort arrays by value (`sort`, `rsort`)
    - sort arrays by value, keeping associativity (`asort`, `arsort`)
    - sort arrays by key (`ksort`, `krsort`)
    - sort arrays by properties (`psort`)
- time-related operations:
    - adds direct access to PHP microtime() function
    - adds direct access to PHP intl\_format() function
- type-related operations:
    - adds direct access to PHP get\_class() and gettype() functions
    - adds support to identify a Twig variable type with new tests (`is array`, `is string`, etc)

Installation &amp; Requirements
-------------------------------

[](#installation--requirements)

Install with [Composer](https://getcomposer.org):

```
composer require jmf/twig-extensions-bundle
```

If you have [Flex](https://symfony.com/packages/Symfony%20Flex) installed, the Twig extensions are then instantly available without any need for initial configuration. If not, complete your `config/bundles.php` file as indicated below:

```
