PHPackages                             zentlix/twig-extensions - 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. zentlix/twig-extensions

ActiveLibrary[Templating &amp; Views](/categories/templating)

zentlix/twig-extensions
=======================

Additional Twig extensions for Spiral Framework.

1.x-dev(3y ago)0916[1 PRs](https://github.com/zentlix/twig-extensions/pulls)MITPHPPHP ^8.1

Since May 4Pushed 2y agoCompare

[ Source](https://github.com/zentlix/twig-extensions)[ Packagist](https://packagist.org/packages/zentlix/twig-extensions)[ Docs](https://github.com/zentlix/twig-extensions)[ RSS](/packages/zentlix-twig-extensions/feed)WikiDiscussions 1.x Synced 1mo ago

READMEChangelogDependencies (9)Versions (2)Used By (0)

Twig Extensions
===============

[](#twig-extensions)

[![PHP Version Require](https://camo.githubusercontent.com/f13af92c6df3d2b1bd7f0d0ee0ae19252a14a85c080552aa660ee6f11a8bb4b6/68747470733a2f2f706f7365722e707567782e6f72672f7a656e746c69782f747769672d657874656e73696f6e732f726571756972652f706870)](https://packagist.org/packages/zentlix/twig-extensions)[![Latest Stable Version](https://camo.githubusercontent.com/69997cc235e4aaf87ccc43356a391185bc64ff295da6d6cc1b247d7397dfccad/68747470733a2f2f706f7365722e707567782e6f72672f7a656e746c69782f747769672d657874656e73696f6e732f762f737461626c65)](https://packagist.org/packages/zentlix/twig-extensions)[![phpunit](https://github.com/zentlix/twig-extensions/actions/workflows/phpunit.yml/badge.svg)](https://github.com/zentlix/twig-extensions/actions)[![psalm](https://github.com/zentlix/twig-extensions/actions/workflows/psalm.yml/badge.svg)](https://github.com/zentlix/twig-extensions/actions)[![Codecov](https://camo.githubusercontent.com/e98e7009542bf089b44f92cd223ab690e199b18a64f2a98df460f6186ff40dae/68747470733a2f2f636f6465636f762e696f2f67682f7a656e746c69782f747769672d657874656e73696f6e732f6272616e63682f312e782f67726170682f62616467652e737667)](https://codecov.io/gh/zentlix/twig-extensions)[![Total Downloads](https://camo.githubusercontent.com/818c7721b05cd2a01f621c6f771b70fd9e8d5964c5adb0a7b1cdb3fc9e55bab4/68747470733a2f2f706f7365722e707567782e6f72672f7a656e746c69782f747769672d657874656e73696f6e732f646f776e6c6f616473)](https://packagist.org/packages/zentlix/twig-extensions)[![type-coverage](https://camo.githubusercontent.com/8450c647abaa94ce3844fc44c749f6e63b242987d85b7f2f66e2e807adec1c9b/68747470733a2f2f73686570686572642e6465762f6769746875622f7a656e746c69782f747769672d657874656e73696f6e732f636f7665726167652e737667)](https://shepherd.dev/github/zentlix/twig-extensions)[![psalm-level](https://camo.githubusercontent.com/c2b6ca2b710b460d307bf42c4466bf8bee8d43be7374f8510cb76a9572ea79d1/68747470733a2f2f73686570686572642e6465762f6769746875622f7a656e746c69782f747769672d657874656e73696f6e732f6c6576656c2e737667)](https://shepherd.dev/github/zentlix/twig-extensions)

Requirements
------------

[](#requirements)

Make sure that your server is configured with following PHP version and extensions:

- PHP 8.1+
- Spiral framework 3.7+

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require zentlix/twig-extensions
```

To enable the package in your Spiral Framework application, you will need to add the `Zentlix\TwigExtensions\Bootloader\ExtensionsBootloader` class to the list of bootloaders in your application:

```
protected const LOAD = [
    // ...
    \Zentlix\TwigExtensions\Bootloader\ExtensionsBootloader::class,
];
```

> **Note**If you are using [`spiral-packages/discoverer`](https://github.com/spiral-packages/discoverer), you don't need to register bootloader by yourself.

Available functions
-------------------

[](#available-functions)

### path

[](#path)

Generate valid route URL using route name and set of parameters.

```
{{ path('user.edit', {'id': 1}) }}
```

Available filters
-----------------

[](#available-filters)

### trans

[](#trans)

Translates the given message.

```
{{ 'message' | trans }}
```

Available tests
---------------

[](#available-tests)

### of\_type

[](#of_type)

Checks that the value is of the correct type. Available checks: `array`, `bool`, `object`, `class`, `float`, `int`, `numeric`, `scalar`, `string`.

```
{% if someVar is of_type('string') %}
    // ...
{% else %}
    // ...
{% endif %}
```

Testing
-------

[](#testing)

```
composer test
```

```
composer psalm
```

```
composer cs
```

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE) for more information.

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1101d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e104cad59c07d048c0b3650db8a2fde19e496e5357ee1ce1a6b3a375cade5e8a?d=identicon)[msmakouz](/maintainers/msmakouz)

---

Top Contributors

[![msmakouz](https://avatars.githubusercontent.com/u/67324318?v=4)](https://github.com/msmakouz "msmakouz (2 commits)")

---

Tags

twigspiral

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/zentlix-twig-extensions/health.svg)

```
[![Health](https://phpackages.com/badges/zentlix-twig-extensions/health.svg)](https://phpackages.com/packages/zentlix-twig-extensions)
```

###  Alternatives

[twig/extra-bundle

A Symfony bundle for extra Twig extensions

91292.0M313](/packages/twig-extra-bundle)[twig/intl-extra

A Twig extension for Intl

36663.2M218](/packages/twig-intl-extra)[twig/string-extra

A Twig extension for Symfony String

21946.0M132](/packages/twig-string-extra)[twig/cssinliner-extra

A Twig extension to allow inlining CSS

23018.5M53](/packages/twig-cssinliner-extra)[symfony/ux-twig-component

Twig components for Symfony

21814.8M161](/packages/symfony-ux-twig-component)[twig/markdown-extra

A Twig extension for Markdown

12114.3M83](/packages/twig-markdown-extra)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
