There is this ajax-index.php file. Is it possible to give a pure snippet output or something like this for Ajax in a page where normally a template is around and how to do this? How to use that ajax-index.php-file?
regards,
Max
I love MODx
-
MODX Staff
- 10,725 Posts
You don’t need index-ajax.php; just create a snippet and place it on a page with no template and have that snippet generate your Ajax response. Nice and simple.
-
☆ A M B ☆
- 24,524 Posts
The reason for all this is that the various MODx classes have to be loaded to enable the modx library functions. So at the very least it needs the config.inc.php file and the document parser class. You can write your own php backend without using the modx libraries; I’ve done that often enough, but the libraries do make things much easier.