/twig-dump-extension

Standalone Symfony VarDumper Twig extension - Adds a dump function in your templates

Primary LanguagePHP

⚠️ This package is abandoned, use Twig-bridge instead.


Twig Dump Extension

Standalone Symfony Var Dumper Twig extension.

Installation

composer require hellonico/twig-dump-extension

Usage

$twig = new Twig_Environment($loader, $options);
$twig->addExtension(new HelloNico\Twig\DumpExtension());

In Twig templates:

{{ dump(foo) }}
{% dump foo %}
{% dump foo, bar %}

Extra

Set some dumper options with the hellonico/var-dumper-configurator package:

composer req hellonico/var-dumper-configurator --dev

See https://github.com/nlemoine/var-dumper-configurator for configuration.