Basically, I have the php class myclass located in root/lib/php/ and I want the classes the autoload from there, whenever I call them.
Now I am trying to do this in the main index.php file. How and where should I properly define spl_autoload_register so that I can use it for static class: myclass::mymethod()?
Typically autoload coded is included in a config file or some other file that is included with each pageload and contains common code required for the site to run.
Static calls to class methods is no different then instanciating a class and calling a method as far as autoload is concerned.
An example:
You then can do this without explicitly requiring the class’ file: