나는 모든 spl_autoload_registers()를 실행하는 "BaseCore"라는 클래스가 있습니다. 이 파일에 있습니다.spl_autoload_register 및 하위 클래스
class BaseCore{
public function __construct(){
spl_autoload_register('loadClasses');
spl_autoload_register('loadConfig');
spl_autoload_register('loadFMAPI');
}
내 두 번째 클래스 내가 BaseCore을 확장 할 때마다 새로운 클래스에, 나는/요구해야하는 BaseCore 클래스를 포함 BaseCore를 확장합니다.
그러나이 방법은 매우 쓸모 없으며 오래된 방법입니다.
내 질문에, 어떻게 require_once() 쓸 필요없이 내 자식 클래스에 BaseCore 포함 할 것이라고 생각합니다; 모든 어린이 계급에?
감사합니다.
이동 spl_autoload_register ('loadClasses'); 프론트 컨트롤러 또는 초기화 스크립트 – Fivell
미안 프론트 컨트롤러 또는 init 스크립트의 의미는 무엇입니까? – DarkMantis
http://en.wikipedia.org/wiki/Front_Controller_pattern – Fivell