Usage
d()
This is the simplest usage, and will output an interactive debugger for the variable passed in.
{{ d(entry) }}
{# or #}
{{ d(entry, otherEntry) }}s()
This works essentially the same way as the built-in Twig dump method, and returns a plain text debugging output.
{{ s(entry) }}
{# or #}
{{ s(entry, otherEntry) }}j()
This works the same way as d(), but logs the variable to your browser’s developer console instead of adding it to the page. This is handy for inspecting values without affecting your page layout.
{{ j(entry) }}
{# or #}
{{ j(entry, otherEntry) }}Each variable is logged with console.log() as an object you can expand in the console. Like d(), output only appears when Craft’s devMode is enabled.
microtime()
Basic reporting of memory usage at the time that the command is run, as well as a timestamp. If used multiple times,
it will also report the time since it was last called and average duration. Passing true as an argument will reset the counter.
{{ microtime() }}You can also reset the counter:
{{ microtime(true) }}trace()
Outputs a PHP backtrace from the point at which the function is called - note, this function uses quite a bit of memory
(you should likely set memory_limit 512M, and the output might not be all that helpful, as you are mostly going to be
seeing compiled PHP from the Twig templates.
{{ trace() }}