1. Go to this page and download the library: Download ericsnguyen/simple-di library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
// you can put your `array` that act as your old DI container to it as param
$container = new class implements \SimpleDi\Container\IContainer(){
// in my library we have SdContainer class that implements IContainer
// but you can implement one if you want.
};
$register = [
YourInterface::class=> YourImplementClass:class
];
SimpleDi::build([
// I have a variable $GLOBALS act as an instances holder for my container
'container'=>new SdContainer($GLOBALS),
// an $register array.
'registry'=>
// at my routes table reader.
$controller = App::resolver($controllerName);