DependencyInjection Container
Register services and wire dependencies with the Symfony DI container.
What is Dependency Injection?
Dependency Injection (DI) is a pattern where a class receives its dependencies from the outside rather than creating them internally — making code testable and loosely coupled.
The Symfony DI Component
Symfony's symfony/dependency-injection component provides a powerful IoC container that can auto-wire, configure, and cache service definitions.
$ composer require symfony/dependency-injectionAll lessons in this course
- HttpFoundation: Request and Response
- DependencyInjection Container
- EventDispatcher: Decoupled Events
- Console Component: CLI Commands