Thank you again! This is really helpful!
Yes, Jason, you’re correct: I’m not extending the MODx class. What I want to do is reference the $modx object to take advantage of its functions. Right now I have a module that instantiates my object:
// Pasted inside into the MODx module code:
include('/path/to/MyObj.php');
$args=array('of' => 'stuff');
$my_obj = new MyObj($args);
And then inside the included MyObj file I have something like this:
global $modx;
$this->MY_modx = &$modx;
That works, but I get the feeling this is really low-brow. Is there a better way to do this?
How is it possible to EXTEND the modx class at runtime ? One of the thing that doesn’t fit in my brain very well is how you sort-of leap-frog the parent and initialize the CHILD: e.g.
class Parent {
// stuff
}
class Child extends Parent
{
// more stuff, function overrides, etc.
}
$extended = new Child();
How would you possibly reference the function overrides etc. in the Child class if you were dealing with an object that was instantiated by
In layman’s terms, how could have a MODx module or snippet override an ALREADY-declared MODx function?