Reputation: 6852
I am trying to make some simple class in MODx but always getting 500 Server error, this ie example.
I created Plugin and call it on webPageinit
Plugin
class Foo {
function HelloWorld() {
echo 'Hello World';
}
}
And then created Snippet and try this
Snippet
$foo = new Foo;
But I am getting internal server error 500, is this proper way to do this, or there is some autolader for your custom class?
Upvotes: 0
Views: 731
Reputation: 857
If you want to use a class inside of MODX, you could load it by $modx->loadClass once. I won't use a plugin to load the class.
Upvotes: 0
Reputation: 831
I think this documentation can give you deeper explanation, especially about making custom back-end programming.
Upvotes: 1