I am trying to create an object from the plugins main file by first requiring a class file in a sub-directory, then creating a new->object, and then calling a method from within the required class file.
However, when I activate the plugin the register_activation_hook() throws an error. What am I doing wrong?
This is not the actual code I am using rather it's an oversimplification.
../plugins/my-plugin/my-plugin.php
require_once( 'classes/test.php' );
$test = new test();
register_activation_hook( __FILE__, array( 'test', 'example' ) );
../plugins/my-plugin/classes/test.php
class test {
static function example() {
echo 'Hello';
}
}