kint-php/kint-twig

Twig extension for Kint integration

2.0 2018-09-29 07:24 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() }}