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

Debug messages

Discussion in 'XenForo Development Discussions' started by karll, Aug 4, 2013.

  1. karll

    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.)
  2. Chris D

    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}
    karll likes this.
  3. karll

    karll Well-Known Member

    Um, and then where does the output end up?
  4. Brogan

    Brogan 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.
    Chris D likes this.
  5. Jeremy

    Jeremy XenForo Moderator Staff Member

Share This Page