We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22702
    • 3 Posts
    Hey guys can you tell me how to load an external class into a snippet?

    I can’t seem to figure it out, for example I’m trying something like. .

     $modx->getObject('ClassName', 'path/to/class'); 
    

    I don’t believe this is the right way to do it so would you guys have any ideas?

    thanks

      • 28042 ☆ A M B ☆
      • 24,524 Posts
      If we’re talking about 1.0 Evo, then
      include_once('path/to/class/file/myobj.php');
      $myobj = new MyObj;

        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org