Dependency injection with Object Manager in Magento
Learn dependency injection in Magento Object Manager for flexible PHP class creation and powerful extensibility.
Lesson Content
Before continuing, let’s take a step back for a moment. If you aren’t familiar with dependency injection, or DI, here’s a brief summary.
Dependency injection is a more structured way to create objects. Rather than using the new keyword to create objects, the classes which you’d like to create objects from are passed into your class’s constructor. In PHP, this is the __construct function.

When code in this class is executed, the classes we passed into the constructor...
Join the discussion!
Comments
Want to comment on this lesson?
Enroll in this course to leave comments.