We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 27733
    • 99 Posts
    This is probably a nit-picky question ... but ... I’m developing an extra for a client and am curious about how supporting files should be arranged. I’ve already looked at the modx documentation, so I’m 99% there. What I have are some supporting php files that my snippet includes ( a class, a helper functions file, etc. ). It seems that the "elements" directory implies files with a direct relation to modx resources. The "model" directory seems like it should only have classes generated by your build file. I’d assume just create an "includes" directory under "elements/snippets" ... but if there’s a standard for the placement of such files, I’d like to follow it. Thx.
      ------
      Server: *nix, ModX Evo 1.0.4, Apache 2.x, PHP 5.x, Mysql 5.x.
      • 24068
      • 4 Posts
      Good question.

      As i’m used to save my class-files and third-party-libs inside a folder named ’lib’ i do that in my extras too.
      • You can create a lib/ or includes/ sub directory. I often put supporting classes and includes in my model/<modelname> directory, just to keep the supporting code together, but there really is no rule that says you have to do it one way or another. The only really important thing is to isolate your component files and identify what goes in core/components/<componentname> vs. what goes in assets/components/<componentname> (usually directly web accessible files like images, css, js, etc. go in the latter).
          • 27733
          • 99 Posts
          OK, good enough. Thanks Jason!
            ------
            Server: *nix, ModX Evo 1.0.4, Apache 2.x, PHP 5.x, Mysql 5.x.