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