PHP code example of fyre / container

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

    

fyre / container example snippets


use Fyre\Container\Container;

$container = new Container($bind);

$container->bind($alias, $factory);

$container->bindAttribute($attribute, $handler);

$instance = $container->build($className, $arguments);

$result = $container->call($callable, $arguments);

$container->clearScoped();

$instance = $container->instance($alias, $instance);

$container->scoped($alias, $factory);

$container->singleton($alias, $factory);

$instance = $container->use($alias, $arguments);

$container = Container::getInstance();

Container::setInstance($container);