changed di recommendation
This commit is contained in:
parent
3f383f8f25
commit
85f6c5bf1c
1 changed files with 1 additions and 2 deletions
|
@ -4,8 +4,7 @@
|
||||||
|
|
||||||
A dependency injector resolves the dependencies of your class and makes sure that the correct objects are injected when the class is instantiated.
|
A dependency injector resolves the dependencies of your class and makes sure that the correct objects are injected when the class is instantiated.
|
||||||
|
|
||||||
My favorite injector is [Auryn](https://github.com/rdlowrey/Auryn), so install `rdlowrey/auryn` with composer or use one of these alternatives:
|
There is only one injector that I can recommend: [Auryn](https://github.com/rdlowrey/Auryn). Sadly all the alternatives that I am aware of are using the [service locator antipattern](http://blog.ploeh.dk/2010/02/03/ServiceLocatorisanAnti-Pattern/).
|
||||||
[Pimple](http://pimple.sensiolabs.org/), [Orno DI](https://github.com/orno/di), [PHP-DI](https://github.com/mnapoli/PHP-DI)
|
|
||||||
|
|
||||||
Create a new file called `Dependencies.php` in your `src/` folder. In there add the following content:
|
Create a new file called `Dependencies.php` in your `src/` folder. In there add the following content:
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue