PHP code example of acvos / bubbles

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

    

acvos / bubbles example snippets


// Instantiating Bubbles facade
$bubbles = new Acvos\Bubbles\ContainerManager();

// Obtaining new DI container
$container = $bubbles->spawn();

// Configuring dependencies
$container
    ->register('zzz', 200)
    ->register('test.service', 'Acvos\Bubbles\Example\TestService')
        ->addDependency('Setter injection example', 'bob')
        ->addDependency('@zzz', 'bar')
        ->addDependency(100, 'foo')
    ->register('test.another.service', 'Acvos\Bubbles\Example\TestService')
        ->addDependency('@test.service')
        ->addDependency('zzz');

// Getting our class instance as a DI service
$service = $container->get('test.another.service');