我已經解決了這個問題,我只需要知道該怎麼做。我得到了上面的錯誤,因爲我剛剛意識到該類正在作爲class :: function($ values)而不是class-> function($ values)運行。
有誰知道如何將此函數轉換爲實例化類,然後運行帶有值的函數?
private function _load($values=null) {
define('LOADED_CONTROLLER', $this->controller);
define('LOADED_FUNCTION', $this->function);
$function = $this->function;
$controller = new $this->controller;
($values == null) ? $controller->$function() : call_user_func_array(array($this->controller, $function), $values);
}
你到底在問什麼?你說你知道問題是什麼,爲什麼你仍然試圖使用'$ this'來工作?你不能在靜態上下文中使用'$ this'。 – ryeguy 2010-03-24 16:28:54