Skip to content
This repository has been archived by the owner on Feb 7, 2023. It is now read-only.

Latest commit

 

History

History
51 lines (41 loc) · 1.4 KB

README.md

File metadata and controls

51 lines (41 loc) · 1.4 KB

🐞 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 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.

Installation

  1. Download a zip archive, rename folder to debug and add it to your modules/ folder.
  2. Add the contents of the app.php file to your config/app.php (or just copy it there if it does not exist)
return [
	'modules' => [
		'debug' => \modules\debug\Debug::class,
	],
	'bootstrap' => [
		'debug',
	],
];
  1. Add the following to your project's composer.json file so that Composer can find your module:
"autoload": {
  "psr-4": {
    "modules\\debug\\": "modules/debug/"
  }
},
  1. Run the following in your command line
composer dump-autoload