Deprecated due to forthcoming debug improvements in Craft 4.4
A simple Craft module, inspired by Mildly Geeky's "Kint", to debug Twig within your browser
{# 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 Symfony's VarDumper #}
{{ dump(var) }}
{# Send the contents of `var` to Symfony's VarDumper and exit #}
{{ dd(var) }}NOTE: If devMode is disabled the debug statement will not be processed.
- Download a zip archive, rename folder to
debugand add it to yourmodules/folder. - Add the contents of the
app.phpfile 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.jsonfile so that Composer can find your module:
"autoload": {
"psr-4": {
"modules\\debug\\": "modules/debug/"
}
},- Run the following in your command line
composer dump-autoload