다음 주 수업에서 다른 클래스에 대해 수업합니다.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);
}
}
** * ****편집*이 **** 이 무시하십시오, 나는 어리석은 실수를하는 기능을 포함 : mssql_escape_string_rev 회 . 시간 재 방송을 위해 죄송합니다.
"함수"가 다른 클래스입니까? – hungneox
'functions'은 정의한 클래스입니까? – Sudantha
예, 정적 함수로 가득 찬 클래스입니다. – LeeTee