Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
[READ-ONLY] Subtree split of the Symfony DependencyInjection Component -- clone into Symfony/Component/ (master at symfony/symfony)
PHP

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
Compiler
Dumper
Exception
Extension
Loader
ParameterBag
Alias.php
Container.php
ContainerAware.php
ContainerAwareInterface.php
ContainerBuilder.php
ContainerInterface.php
Definition.php
DefinitionDecorator.php
LICENSE
Parameter.php
README.md
Reference.php
Scope.php
ScopeInterface.php
SimpleXMLElement.php
TaggedContainerInterface.php
Variable.php
composer.json

README.md

DependencyInjection Component

DependencyInjection manages your services via a robust and flexible Dependency Injection Container.

Here is a simple example that shows how to register services and parameters:

use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Reference;

$sc = new ContainerBuilder();
$sc
    ->register('foo', '%foo.class%')
    ->addArgument(new Reference('bar'))
;
$sc->setParameter('foo.class', 'Foo');

$sc->get('foo');

Resources

Unit tests:

https://github.com/symfony/symfony/tree/master/tests/Symfony/Tests/Component/DependencyInjection

Something went wrong with that request. Please try again.