|
%!s(int64=13) %!d(string=hai) anos | |
---|---|---|
.. | ||
Compiler | %!s(int64=13) %!d(string=hai) anos | |
Dumper | %!s(int64=13) %!d(string=hai) anos | |
Exception | %!s(int64=14) %!d(string=hai) anos | |
Extension | %!s(int64=14) %!d(string=hai) anos | |
Loader | %!s(int64=13) %!d(string=hai) anos | |
ParameterBag | %!s(int64=13) %!d(string=hai) anos | |
Alias.php | %!s(int64=14) %!d(string=hai) anos | |
Container.php | %!s(int64=13) %!d(string=hai) anos | |
ContainerAware.php | %!s(int64=14) %!d(string=hai) anos | |
ContainerAwareInterface.php | %!s(int64=14) %!d(string=hai) anos | |
ContainerBuilder.php | %!s(int64=13) %!d(string=hai) anos | |
ContainerInterface.php | %!s(int64=13) %!d(string=hai) anos | |
Definition.php | %!s(int64=13) %!d(string=hai) anos | |
DefinitionDecorator.php | %!s(int64=13) %!d(string=hai) anos | |
LICENSE | %!s(int64=13) %!d(string=hai) anos | |
Parameter.php | %!s(int64=14) %!d(string=hai) anos | |
README.md | %!s(int64=13) %!d(string=hai) anos | |
Reference.php | %!s(int64=13) %!d(string=hai) anos | |
Scope.php | %!s(int64=14) %!d(string=hai) anos | |
ScopeInterface.php | %!s(int64=14) %!d(string=hai) anos | |
SimpleXMLElement.php | %!s(int64=13) %!d(string=hai) anos | |
TaggedContainerInterface.php | %!s(int64=14) %!d(string=hai) anos | |
Variable.php | %!s(int64=14) %!d(string=hai) anos | |
composer.json | %!s(int64=13) %!d(string=hai) anos |
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