1. Go to this page and download the library: Download renakdup/simple-dic 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/ */
renakdup / simple-dic example snippets
use Renakdup\SimpleDIC\Container;
// create container
$container = new Container();
// set service
$container->set( Paypal::class, function () {
return new Paypal();
} );
// get service
$paypal = $container->get( Paypal::class );
// use this object
$paypal->pay();