0
I have these functions:
core/init.php:
...
spl_autoload_register(function($class) {
require_once ('libs/'.$class.'.php');
});
---
controllers/Images_controller.php
require_once "core/init.php";
require_once "models/Image.php";
require_once "models/User.php";
class Images_Controller extends Controller {
...
}
Since libs are some classes that I will need throughout the program, that is, I will need to order the libs no doubt, but I will also need to order the models I need, this is a model mvc, the paths are in relation to the index.
My question is, how do I do, inside the core/init.php
, that the program makes load ALSO models as I instantiate them?
Why not recommend? Thank you worked
– Miguel
Precisely because it is an old technology. Nowadays we have Composer, a great dependency manager, I recommend researching about.
– juniorb2ss