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
Fabien Potencier 5d6a7d35b0 merged 2.0
2011-12-18 14:48:17 +01:00
..
Compiler merged 2.0 2011-12-18 14:48:17 +01:00
Dumper merged 2.0 2011-12-18 14:48:17 +01:00
Exception [DependencyInjection] Create additional SPL exceptions 2011-12-04 22:17:41 -08:00
Extension fixed CS 2011-12-18 14:36:25 +01:00
Loader merged 2.0 2011-12-18 14:48:17 +01:00
ParameterBag merged 2.0 2011-12-13 16:12:53 +01:00
Alias.php [DependencyInjection] tagged the public @api 2011-07-20 10:50:27 +02:00
composer.json merged 2.0 2011-11-23 23:28:22 +01:00
Container.php merged 2.0 2011-12-13 16:12:53 +01:00
ContainerAware.php [DependencyInjection] tagged the public @api 2011-07-20 10:50:27 +02:00
ContainerAwareInterface.php [DependencyInjection] tagged the public @api 2011-07-20 10:50:27 +02:00
ContainerBuilder.php merged 2.0 2011-12-18 14:48:17 +01:00
ContainerInterface.php merged 2.0 2011-12-13 16:12:53 +01:00
Definition.php merged 2.0 2011-12-13 16:12:53 +01:00
DefinitionDecorator.php [DependencyInjection] Use component-specific SPL exceptions 2011-12-04 22:21:11 -08:00
LICENSE
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 [DependencyInjection] tagged the public @api 2011-07-20 10:50:27 +02:00
SimpleXMLElement.php [DoctrineBridge] fixed some CS 2011-12-13 10:22:12 +01:00
TaggedContainerInterface.php [DependencyInjection] tagged the public @api 2011-07-20 10:50:27 +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