|
13 年之前 | |
---|---|---|
.. | ||
Compiler | 13 年之前 | |
Dumper | 13 年之前 | |
Exception | 13 年之前 | |
Extension | 13 年之前 | |
Loader | 13 年之前 | |
ParameterBag | 13 年之前 | |
Alias.php | 13 年之前 | |
Container.php | 13 年之前 | |
ContainerAware.php | 13 年之前 | |
ContainerAwareInterface.php | 13 年之前 | |
ContainerBuilder.php | 13 年之前 | |
ContainerInterface.php | 13 年之前 | |
Definition.php | 13 年之前 | |
DefinitionDecorator.php | 13 年之前 | |
Parameter.php | 13 年之前 | |
README.md | 13 年之前 | |
Reference.php | 13 年之前 | |
Scope.php | 13 年之前 | |
ScopeInterface.php | 13 年之前 | |
SimpleXMLElement.php | 13 年之前 | |
TaggedContainerInterface.php | 13 年之前 | |
Variable.php | 13 年之前 | |
composer.json | 13 年之前 |
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