nikic / FastRoute

Fast request router for PHP
Other
5.12k stars 445 forks source link

Dependency Injection #188

Closed realrecordzLab closed 5 years ago

realrecordzLab commented 5 years ago

We are giving a try to this nice product to made a tiny custom CMS. We need to make some dependency injection and for this task we will uset PHP-DI project. Can anyone give to us a sample of how to make this two libraries interact?

WeaponsTheyFear commented 5 years ago

It doesn't use PHP-DI (and I have yet to use it), but there is a tutorial that uses fast route with DI using Auryn. https://github.com/PatrickLouys/no-framework-tutorial. I would imagine the same principals apply.

lcobucci commented 5 years ago

Indeed, one should build the logic for plugging the library to any DI container. I use Zend Expressive with FastRoute and Symfony DI and it works like a charm :smile:

I'll close this issue, feel free to comment/reopen if you'd like to extend your question.