🐞
Debug
A simple Craft module, inspired by Mildly Geeky's "Kint", to debug Twig within your browser
Usage
{# Send the contents of `var` to a console.log() #}
{{ debug(var) }}
{# Send the contents of `var` to a console.table() #}
{{ debug(var, { view: 'table' }) }}
{# Send the contents of `var` to an instance of Symfony's VarDumper component #}
{{ debug(var, { view: 'inline' }) }}
NOTE: If devMode is disabled the debug statement will not be processed.
Installation
- Download a zip archive, rename folder to
debug
and add it to yourmodules/
folder. - Add the contents of the
app.php
file to yourconfig/app.php
(or just copy it there if it does not exist)
return [
'modules' => [
'debug' => \modules\debug\Debug::class,
],
'bootstrap' => [
'debug',
],
];
- Add the following to your project's
composer.json
file so that Composer can find your module:
"autoload": {
"psr-4": {
"modules\\debug\\": "modules/debug/"
}
},
- Run the following in your command line
composer dump-autoload