We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 50923
    • 137 Posts
    I have see that, fixed already, tried again and no luck
      <a href="www.play2web.com" title="izrada web sajtova">Izrada web sajtova</a>
    • discuss.answer
      • 4172
      • 5,888 Posts
      I have a file core/classes/foo.class.php

      with

      <?php
      
      class Foo {
          function HelloWorld() {
             $message = 'Hello World';
          return $message;
          }
      }
      


      and a snippet Foo with

      if (!$modx->loadClass('Foo',MODX_CORE_PATH.'classes/',true,true)) {
          die('Could not load class Foo!');
      }
      
      $Box = new Foo();
       
      $message =  $Box->HelloWorld();
      echo $message;
      


      and this does work for me.
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 50923
        • 137 Posts
        I think you are missisng a line to load class?
          <a href="www.play2web.com" title="izrada web sajtova">Izrada web sajtova</a>
          • 4172
          • 5,888 Posts
          you don't need $modx->loadClass a second time.
          the class is loaded in the if-statement.

            -------------------------------

            you can buy me a beer, if you like MIGX

            http://webcmsolutions.de/migx.html

            Thanks!