This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
symfony/src/Symfony/Component/DependencyInjection
2012-07-09 14:43:50 +02:00
..
Compiler fixed CS (mainly method signatures) 2012-07-09 14:43:50 +02:00
Dumper fixed CS (mainly method signatures) 2012-07-09 14:43:50 +02:00
Exception Removed executable bits from all php files 2011-09-09 15:16:17 +02:00
Extension fixed CS (mainly method signatures) 2012-07-09 14:43:50 +02:00
Loader fixed CS (mainly method signatures) 2012-07-09 14:43:50 +02:00
ParameterBag fixed CS (mainly method signatures) 2012-07-09 14:43:50 +02:00
Alias.php fixed phpdoc @param alignment 2012-05-15 18:56:32 +02:00
composer.json removed the version attribute in all composer.json files 2012-01-05 14:51:20 +01:00
Container.php fixed CS (mainly method signatures) 2012-07-09 14:43:50 +02:00
ContainerAware.php [DependencyInjection] tagged the public @api 2011-07-20 10:50:27 +02:00
ContainerAwareInterface.php fixed CS (mainly method signatures) 2012-07-09 14:43:50 +02:00
ContainerBuilder.php fixed CS (mainly method signatures) 2012-07-09 14:43:50 +02:00
ContainerInterface.php fixed CS (mainly method signatures) 2012-07-09 14:43:50 +02:00
Definition.php fixed CS 2012-05-18 19:37:58 +02:00
DefinitionDecorator.php fixed CS 2012-05-18 19:37:58 +02:00
LICENSE Updated LICENSE files copyright 2012-02-22 10:10:37 +01:00
Parameter.php [DependencyInjection] tagged the public @api 2011-07-20 10:50:27 +02:00
README.md tweaked the README files 2011-12-18 14:22:28 +01:00
Reference.php [DependencyInjection] Made the reference case insensitive 2011-12-08 16:30:50 +01:00
Scope.php [DependencyInjection] tagged the public @api 2011-07-20 10:50:27 +02:00
ScopeInterface.php fixed CS (mainly method signatures) 2012-07-09 14:43:50 +02:00
SimpleXMLElement.php fixed CS (mainly method signatures) 2012-07-09 14:43:50 +02:00
TaggedContainerInterface.php fixed CS (mainly method signatures) 2012-07-09 14:43:50 +02:00
Variable.php fixed CS 2011-06-08 12:16:48 +02:00

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