PHP code example of next / di

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

    

next / di example snippets


$container = \Next\Di\Context::getContainer();
$container = container();

$container->bind(TestInterface::class, Test::class);

$container->make(Test::class);

$container->get(Test::class);

$conatiner->call(callable $callable, array $arguments = []);