class JController{
public static function getInstance()
{
//some source, not important...
self::createFile();//
}
public static function createFile()
{
// this is base class method
}
}
class CustomController extends JController{
public static function createFile()
{
// this is overriden class method
}
}
,我試圖調用派生類的靜態方法,它調用的父母方法和未覆蓋。它預期的行爲?
這就是我嘗試使用它:
$controllerInstance = CustomController::getInstance();
我的問題是:在CustomController :: CREATEFILE爲什麼不CustomController ::的getInstance()調用()?
可能重複http://stackoverflow.com/questions/13174343/overriding-static-methods-in -php) – Neal
是的,它是一個重複的,沒有找到它.. – insanebits