r/PHPhelp • • May 30 '18

PHP Dependency Injection tutorials?

I need a tutorial on using Dependency Injection/IOC in PHP. We are going to build an API and want the output formatters to be "pluggable" meaning we may use DI to accomplish this. I don't know how to do DI in PHP and need some brushing up on it.

9 Upvotes

6 comments sorted by

View all comments

1

u/doitstuart May 30 '18

The oft-cited no-framework tutorial has a good section on wiring up DI at the nuts and bolts level:

https://github.com/PatrickLouys/no-framework-tutorial/blob/master/08-dependency-injector.md