I am trying to figure out how to use a method within its own class. example:
class demoClass
{
function demoFunction1()
{
//function code here
}
function demoFunction2()
{
//call previously declared method
demoFunction1();
}
}
The only way that I have found to be working is when I create a new intsnace of the class within the method, and then call it. Example:
class demoClass
{
function demoFunction1()
{
//function code here
}
function demoFunction2()
{
$thisClassInstance = new demoClass();
//call previously declared method
$thisClassInstance->demoFunction1();
}
}
but that does not feel right… or is that the way?
any help?
thanks
$this->inside of an object, orself::in a static context (either for or from a static method).