Debt Consolidation - Wordpress Themes - Debt Consolidation - Expekt bonuses - Deaf Topics

PDA

View Full Version : Calling a static function from the same class


jestep
May 8th 2007, 9:08 am
I'm not sure the best way to do this. Just looking for the right way to go about doing this. I just need to call a static method from a normal method within the same class.

Example:


class someStupidClass {

function thisOne (){

//do stuff

//call static function

return $this->output;

}

public static function getInfo(){

//some database stuff

return $info;

}

}


Woould I call it the same as I would from outside the class?

Ex: $this->info = someStupidClass::getInfo();

xooMan
May 11th 2007, 2:40 am
Yes, this is a typical way of calling static methods:
ClassName::MethodName()

SecondV
May 11th 2007, 3:55 am
self::getInfo();