Saturday 23 December 2017

php - Explanation Dependency Injection

Can anyone help me explaining in 'easy words'




  1. When should I use
    dependency injection.

  2. Why should I use it? ( Should I use
    it in combination OR not with MVC?)


  3. What does
    in it easy words ? How is it working

  4. Is it like creating
    a factory for recycling your code/scripts?

  5. How does it
    interact and how do I call it when I use a front-controler ( For example )



Those questions are
already on stack, but I still have some problems understanding them.
So I am
really looking for a simple explanation.



I
currently set up my projects the following way ( Dummy )
href="http://pastebin.com/WJau2CyZ"
rel="nofollow">http://pastebin.com/WJau2CyZ

And I have
no clue how exact to implement DI.

No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...