karll Well-known member Aug 4, 2013 #1 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.)
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 Aug 4, 2013 #2 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}
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}
Paul B XenForo moderator Staff member Aug 7, 2013 #4 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.
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.
Jeremy in memoriam 1991-2020 Aug 8, 2013 #5 It roughly corresponds to this: http://us3.php.net/manual/en/function.var-dump.php (although, it uses Zend_Debug I believe). Its a way to tell what's in a variable.
It roughly corresponds to this: http://us3.php.net/manual/en/function.var-dump.php (although, it uses Zend_Debug I believe). Its a way to tell what's in a variable.