PHP code example of netolabs / simple-container
1. Go to this page and download the library: Download netolabs/simple-container 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/ */
netolabs / simple-container example snippets
php
if ($container->has(MySuperCoolService::class) {
$service = $container->get(MySuperCoolService::class);
}
php
$value = $container->resolve('myCallable');
// value is 'a computed value'