다양한 에러를 포함하는 함수가있는 클래스 파일을 만들었습니다. 이 함수를 config.php 파일로 옮기고 싶습니다.PHP 클래스 내의 설정 파일 데이터에 접근하기
어떻게 그 기능을 계속 사용합니까? config.php 안에 있습니까?
함수 :
private function error($errnum=1000) {
$data = array(
'1000' => 'Required parameter is missing',
'1100' => 'Parameter not recognized',
'2000' => 'Currency type not recognized',
'2100' => 'Currency amount must be to 2 decimal places',
'2200' => 'Currencies cannot be the same',
'3000' => 'Service currently unavailable',
'3100' => 'Error in service'
);
$this->result($data[$errnum], $errnum);
}
I 사용하려고 :
require_once를 ("설정/config.php 파일을");
클래스 파일에서하지만 여전히 오류를 보여줍니다
구문 분석 오류 : 구문 오류, 예기치 못한 T_PRIVATE
'오류'는 어쨌든 * 함수 *에 대해 약간 너무 일반적이거나 모호한 이름이라는 점을 지적하고자합니다. – mario