Sophisticated, Lightweight and Simple

Jump to docs navigation
Edit on GitHub

Internals ยป backtrace() Twig tag

Using this function you can get a backtrace throught the code to the current point in the execution. Useful for when you're debugging something, and you're not quite sure how you got here to begin with. In your templates, use the following:

    {{ backtrace() }}

In your code you can also use backtrace, like this:

    use Symfony\Component\VarDumper\VarDumper;


Or, using the (global) shortcut:


The optional parameters denotes the options and maximum depth of the output of the backtrace. See the page on debug-backtrace.php().

Couldn't find what you were looking for? We are happy to help you in the forum, on Slack or on IRC.
Spotted a typo, or have something to add? Edit this page on GitHub.