We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36764 ☆ A M B ☆
    • 45 Posts
    Evengard aka Eiventeleiron Reply #1, 14 years ago
    Hello everyone!

    Feeling myself completely overhelming after reading all this stuff about controllers, processors and connectors in the documentation...

    1. Well, first question. When reading the documentation on how to create a custom Resource Class (http://rtfm.modx.com/display/revolution20/Creating+a+Resource+Class) the controllers of this objects are created inside the core/components/<packagename>/controllers folder, while all the controllers seems to be stored inside manager/controllers/<packagename>(default)/ folder! (If I understood that well, "default" is in fact something like a package name?)
    What is the way to go?

    2. And second question. Is it recommended to use these Processors, Controllers and Connectors on my Frontend? I want to do a lot of AJAX. If not, what is the correct way to go?

    This question has been answered by Bruno17. See the first response.

      • 36764 ☆ A M B ☆
      • 45 Posts
      Evengard aka Eiventeleiron Reply #2, 14 years ago
      I've found this topic: https://forums.modx.com/thread/?thread=31535 - but here it was discussed before Revo 2.1, so it is a "bit" outdated.

      Also found thiss on stackoverflow: http://stackoverflow.com/questions/10395660/front-end-ajax-in-modx-revolution/10428906 - is that the way to go? Or is there some more elegant solution?
        • 36764 ☆ A M B ☆
        • 45 Posts
        Evengard aka Eiventeleiron Reply #3, 14 years ago
        Well, looking in the source code it seems that still the connectors are designed for manager use only (because of modConnectorRequest is an extention of modManagerRequest, exactly what was described in https://forums.modx.com/thread/?thread=31535 , so, probably nothing changed), and using the "stackoverflow" solution seems to me... Well, I didn't really liked it - faking the MODX autentication mechanism isn't good.

        Probably still the best way to go is use the "resource connector". Probably every context should have its own "resource connector" with a snippet inside...

        Can you confirm?
        • discuss.answer
          • 4172
          • 5,888 Posts

          Probably still the best way to go is use the "resource connector". Probably every context should have its own "resource connector" with a snippet inside...

          I think, this is the simplest and best way.
          Sometimes (for resource-related ajax-requests) I use the same resource as ajax-connector and normal resource-output, just switch the output by a snippet, which calls either a chunk for the normal output or the ajax-output. This can also be cached by getCache for example.
            -------------------------------

            you can buy me a beer, if you like MIGX

            http://webcmsolutions.de/migx.html

            Thanks!
            • 36764 ☆ A M B ☆
            • 45 Posts
            Evengard aka Eiventeleiron Reply #5, 14 years ago
            Thanks!