Hi there,
I’m making a call to the modx object in an include file.
I have:
global $modx;
at the top of the page, but cannot access the object.
I’m calling this page using ajax (don’t see why this would matter?)
For some reason it just wont access $modx??
Any ideas? Thanks.
J
-
☆ A M B ☆
- 24,524 Posts
First you have to include the config.inc.php and document.parser.inc.php files, then instantiate a new $modx object from it. Then you can access the $modx object’s functions. Take a look at the index.php file to see how it’s done.
The easy way around this is to use a modx document as the AJAX page, that way you have native access to $modx
Thats a good idea, I shall do that.