kint-php/kint-twig

Twig extension for Kint integration

3.0 2020-07-03 14:19 UTC

This package is auto-updated.

Last update: 2020-08-03 14:43:13 UTC


README

A Twig extension providing the familiar d() and s() functions for dumping data.

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

Usage

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

{{ s(data, plainMode) }}

Custom function names:

$ext = new Kint\Twig\TwigExtension();
$ext->setAliases([
    // Function name => Renderer
    'dump' => 'Kint\\Renderer\\RichRenderer',
]);
$twig->addExtension($ext);
{{ dump() }}