Debug messages

karll

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.)
 
In PHP files, as we have access to the Zend Framework I prefer to use:

PHP:
Zend_Debug::dump($variable);

In XenForo templates, you can use:

Code:
{xen:helper dump, $variable}
 
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:
Code:
{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.
 
Top Bottom