PHP code example of digphp / psr11
1. Go to this page and download the library: Download digphp/psr11 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/ */
digphp / psr11 example snippets
php
$container = new \DigPHP\Psr11\Container();
$container->set('test', function(){
return 'bar';
});
$container->get('test'); // bar
// dependency injection container
$monolog = $container->get(\Monolog\Logger::class);