I have a nusoap class, with some methods defined in the constructor. The problem I'm having however, is calling a method either from a model I loaded or a method defined in the same class out of the constructor. The error I get is "Using $this when not in object context". None of the methods are static, so I'm not sure why it's having trouble accessing this. For reference, here is an example of what I'm trying to do.
edit: This is my first time working with nusoap, and the methods were defined in the constructor in all the examples I saw. If the methods do not need to be defined in the constructor, where do I define them?
class MySoapServer extends CI_Controller {
function __construct() {
parent::__construct();
//where I'm loading all my models and libraries,
//creating a new instance of soap server
//and registering all my methods
function myFunction() {
$this->testFunction() //this is where it errors out
}
}
function testFunction() {
return true;
}
}