-
☆ A M B ☆
- 24,524 Posts
Are you referring to the AJAX in the back-end? If so, then your AJAX processor files are totally independent of the module itself, and need to include the config.inc.php and document.parser.class.inc.php themselves, and instantiate an instance of a $modx object. I chose not to use the $modx object or the dbapi; I only included the config.inc.php to get the database details and used raw PHP mysql functions.
You could also put your external AJAX processing code in snippets, and include them in documents, calling the URL to the documents in your AJAX requests. This would make all of the api functions available to you. The documents would have to be published; I would create an unpublished container document to hold them so they won’t get mixed up with actual front-end page documents.
My site just got a new template, and I’m still working on it, getting the menus and styling organized; the following pages of that series of articles were not exposed yet. They are now; links to the other articles are at the bottom of each page (until I get side menus worked out!)