|
|
12 years ago | |
|---|---|---|
| .. | ||
| Compiler | 12 years ago | |
| Dumper | 12 years ago | |
| Exception | 12 years ago | |
| Extension | 12 years ago | |
| Loader | 12 years ago | |
| ParameterBag | 12 years ago | |
| Alias.php | 12 years ago | |
| Container.php | 12 years ago | |
| ContainerAware.php | 12 years ago | |
| ContainerAwareInterface.php | 12 years ago | |
| ContainerBuilder.php | 12 years ago | |
| ContainerInterface.php | 12 years ago | |
| Definition.php | 12 years ago | |
| DefinitionDecorator.php | 12 years ago | |
| Parameter.php | 12 years ago | |
| README.md | 12 years ago | |
| Reference.php | 12 years ago | |
| Scope.php | 12 years ago | |
| ScopeInterface.php | 12 years ago | |
| SimpleXMLElement.php | 12 years ago | |
| TaggedContainerInterface.php | 12 years ago | |
| Variable.php | 12 years ago | |
| composer.json | 12 years ago | |
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');
Unit tests:
https://github.com/symfony/symfony/tree/master/tests/Symfony/Tests/Component/DependencyInjection