私のメインクラスには次のクラスがあります。php OOP - クラス内の別のクラスからスタティックメソッドを呼び出す
class Products
{
public function __get($key){
return trim(functions::mssql_escape_string_rev($this->fields[ $key ]));
}
}
この人間バックエラー:またはこれを行うことができない私の構文と間違って何かがCall to undefined method functions::mssql_escape_string_rev()
ありますか?
以下は、クラスの自動読み込みに使用されるコードです。他のすべてのクラスで使用できますので、コードに間違いがないことがわかります。それはクラス内で始まるようではありません。
**// autoloader function called when we try to instantiate a class but haven't included the file
function __autoload($resource_name){
$resource_name = trim($resource_name);
try {
$filepath = CLASS_PATH."/class.".$resource_name.".inc.php";
if(@!include($filepath)){
throw new Exception('');
}
} catch(Exception $e) {
exit("Could not find the required file: ".$resource_name);
}
}
* ****EDITは* **** これを無視してください、私は愚かなミスを犯したと機能を含め:: mssql_escape_string_rev倍。時間のお寄せください。
「機能」は別のクラスですか? – hungneox
'functions'はあなたが定義したクラスですか? – Sudantha
はい、静的関数でいっぱいのクラスです。 – LeeTee