• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Debug messages


Well-known member
Is there an easy way to print debug messages, either to a log file or to the screen somewhere?

(Yes, I'm more or less a total newbie to PHP and XF add-on development.)

Chris D

XenForo developer
Staff member
In PHP files, as we have access to the Zend Framework I prefer to use:

In XenForo templates, you can use:

{xen:helper dump, $variable}


XenForo moderator
Staff member
It is output on the page, depending on where you place it in the template.

For example, try entering this in the forum_list template:
{xen:helper dump, $user}
Place it above the hook for the node list and it prints out above the node list.
Place it at the end of the template and it prints out below.