PHPackages                             lukasbableck/contao-twig-utils-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. lukasbableck/contao-twig-utils-bundle

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

lukasbableck/contao-twig-utils-bundle
=====================================

This bundle provides some useful additional twig functions and filters for Contao Open Source CMS.

1.5.0(6mo ago)1152LGPL-3.0-or-laterPHPPHP ^8.1

Since Mar 5Pushed 6mo ago1 watchersCompare

[ Source](https://github.com/lukasbableck/contao-twig-utils-bundle)[ Packagist](https://packagist.org/packages/lukasbableck/contao-twig-utils-bundle)[ GitHub Sponsors](https://github.com/lukasbableck)[ RSS](/packages/lukasbableck-contao-twig-utils-bundle/feed)WikiDiscussions main Synced 3w ago

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

contao-twig-utils-bundle
========================

[](#contao-twig-utils-bundle)

This bundle provides some useful additional twig functions and filters for Contao Open Source CMS.

Filters
-------

[](#filters)

### `json_decode(?bool $assoc = false)`

[](#json_decodebool-assoc--false)

Decodes a JSON string into a PHP array or object.

### `to_array`

[](#to_array)

Converts a given value to an array. If the value is already an array, its children are converted to arrays as well.

Functions
---------

[](#functions)

### `contao_config()`

[](#contao_config)

Returns the Contao Config object.

### `contao_form(id|alias)`

[](#contao_formidalias)

Generates a form and returns the html output.

### `file(id|uuid|path)`

[](#fileiduuidpath)

Returns the FilesModel for the given id, uuid or path.

### `page(id|alias, ?bool $published = false)`

[](#pageidalias-bool-published--false)

Returns the PageModel for the given id or alias. If `$published` is set to `true`, it will only return published pages.

### `reading_time(text, ?int $wpm = 250)`

[](#reading_timetext-int-wpm--250)

Estimates the reading time for the given text based on the provided words per minute (default is 250 wpm). The function returns the reading time in seconds.

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance68

Regular maintenance activity

Popularity13

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 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

Every ~40 days

Recently: every ~49 days

Total

8

Last Release

189d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0154055676f978a6dc41986c2923866b7d344ccfaca7fe23b4f46953d96fbec3?d=identicon)[lukasbableck](/maintainers/lukasbableck)

---

Top Contributors

[![lukasbableck](https://avatars.githubusercontent.com/u/42083846?v=4)](https://github.com/lukasbableck "lukasbableck (13 commits)")

---

Tags

twigfilterfunctionbackend

###  Code Quality

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/lukasbableck-contao-twig-utils-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/lukasbableck-contao-twig-utils-bundle/health.svg)](https://phpackages.com/packages/lukasbableck-contao-twig-utils-bundle)
```

###  Alternatives

[dpolac/twig-lambda

Lambda expressions for Twig and filters that make use of them

45208.4k1](/packages/dpolac-twig-lambda)[text/template

Simple and secure string-template-engine (Twig-like syntax) with nested if/elseif/else, loops, filters. Simple OOP api: Just one class doing the job (2-lines of code). Fast and secure: No code-generation, no eval'ed() code. Extensible by callbacks. Fully tested. Rich examples included.

38204.1k10](/packages/text-template)[gecko-packages/gecko-twig

Additional Twig filters and tests.

1013.0k](/packages/gecko-packages-gecko-twig)

PHPackages © 2026

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