Using spl_autoload_register with classes that require an argument upon instantiation

StackOverflow https://stackoverflow.com/questions/5949682

  •  07-11-2019
  •  | 
  •  

문제

I'm trying to use spl_autoload_register() to automatically require my files for me. Unfortunately one of my classes requires an argument upon instantiation...eg:

$foo = new foo('foo');

Is there any way to pass an argument to a classes __construct() method with spl_autoload_register()?

올바른 솔루션이 없습니다

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top