<div id="container-api" class="container">

    <h2><a href="#container-api">Powerful container API</a></h2>

    <p class="text-center">
        PHP-DI provides the classic API of a container as well as advanced features useful to build or extend a framework.
    </p>

    <div class="row">

        <div class="col-md-6">
            <h4>
                Get & Has
                <a class="read-more" href="doc/container.html#get-amp-has" title="PSR-11 methods">read more</a>
            </h4>
            <p>
                PHP-DI is compliant with <a href="http://www.php-fig.org/psr/psr-11/">PSR-11</a>:
            </p>
            <pre><code class="php">$container->get($name);
$container->has($name);</code></pre>
        </div>

        <div class="col-md-6">
            <h4>
                Make
                <a class="read-more" href="doc/container.html#make">read more</a>
            </h4>
            <p>
                Use the container as a factory:
            </p>
            <pre><code class="php">$parameters = [ ... ];
$container->make(Foo::class, $parameters);</code></pre>
            <p>
                Missing constructor parameters will be resolved from the container.
            </p>
        </div>

        <div class="col-md-12">
            <h4>
                Invoke a callable
                <a class="read-more" href="doc/container.html#call">read more</a>
            </h4>
            <p>
                Dependency injection in callables, à la AngularJS:
            </p>
            <pre><code class="php">$container->call(function (Logger $logger, EntityManager $em) {
    // ...
});</code></pre>
        </div>

    </div>

    <p class="text-center">
        <a href="doc/container.html" class="btn btn-default">Learn more</a>
    </p>

</div>
