Twig extension for Kint integration

5.0 2022-11-22 10:10 UTC

This package is auto-updated.

Last update: 2023-09-22 12:53:28 UTC


A Twig extension providing the familiar Kint functionality for dumping data.

Note that features like the mini-trace, variable name detection, and modifiers will not work from inside twig templates.


$twig->addExtension(new Kint\Twig\TwigExtension());
{{ d(data, richMode, moreData, evenMoreData) }}

{{ s(data, plainMode) }}

Custom function names dumpers:

$ext = new Kint\Twig\TwigExtension();

$aliases = $ext->getAliases();

// Different alias for existing dumper
$aliases['dump'] = $aliases['d'];

// Custom dumper
$text = new Kint\Kint(new Kint\Parser\Parser(), new Kint\Renderer\TextRenderer());

$aliases['text'] = $text;


{{ dump() }}
{{ text() }}