lukasbableck/contao-twig-utils-bundle

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

Fund package maintenance!
lukasbableck

Installs: 101

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 1

Forks: 0

Open Issues: 0

Type:contao-bundle

pkg:composer/lukasbableck/contao-twig-utils-bundle

1.5.0 2025-12-16 13:04 UTC

This package is auto-updated.

Last update: 2025-12-16 13:05:32 UTC


README

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

Filters

json_decode(?bool $assoc = false)

Decodes a JSON string into a PHP array or object.

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

contao_config()

Returns the Contao Config object.

contao_form(id|alias)

Generates a form and returns the html output.

file(id|uuid|path)

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

page(id|alias, ?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)

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.