We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 35409
    • 25 Posts
    Hello,

    i want to debug my own snippet to be sure it works fine.
    i read documention here to do that.

    i obtain a blank page.
    What is the right syntax to obtain the absolute path in file parameter when i call include snippet ?
    Where do i put include snippet call ?
    How does it work with snippet parameters ?

    i’m using Netbeans with xdebug and it works fine with another project without modx.

    Thanks a lot for explanations
    Manu

      Manu
      • 35409
      • 25 Posts
      Thanks to the good Bob Ray’s FAQ wink

      Under the question How should I include files in a snippet?
      The answser
      include $modx->config[’base_path’] . ’assets/snippets/mysnippet/myfile.php’;

      Then I simply replace the snippet’s code I want to test by an include line which point to the external file.
      Example with peoplegroup snippet
      include $modx->config[’core_path’]. ’components/peoples/elements/snippets/snippet.peoplegroup.php’;

      Then I put breakpoint with netbeans in the external file. It’s useful to understand how it works.
        Manu