PHP code example of ultra-lite / composite-container

1. Go to this page and download the library: Download ultra-lite/composite-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/ */

    

ultra-lite / composite-container example snippets


$compositeContainer = new \UltraLite\CompositeContainer\CompositeContainer();

$compositeContainer->addContainer($container);
$container->setDelegateContainer($compositeContainer); // or appropriate method on Delegate Lookup container

if ($compositeContainer->has($serviceId) {
    $compositeContainer->get($serviceId);
}