dannyvankooten / PHP-Router

Simple PHP Router class (supports REST and reverse routing)
MIT License
563 stars 124 forks source link

DI #44

Open cawa87 opened 9 years ago

cawa87 commented 9 years ago

Hey, nice router. But it would be nice if it'll have and mechanism to inject some dependencies in controller\action.

malukenho commented 9 years ago

@CawaKharkov It's a great ideia! have you thinking in anything?

cawa87 commented 9 years ago

@malukenho I've modified router to inject service container.

cawa87 commented 9 years ago

And I think it would be nice, if user want to inject something to your controller you need to implement some interface InjectableInterface. And when calling dispatch inject container(or some service) to your controller.

malukenho commented 9 years ago

@CawaKharkov can you open a PR please? :D

cawa87 commented 9 years ago

@malukenho #45 PR

mbunge commented 8 years ago

It would be cool to use as foundation. https://github.com/container-interop/container-interop

And nobody is forced to use a specific DI-Package.

mo-ba commented 8 years ago

i think routing and DI are different concerns and should not be mixed...

malukenho commented 8 years ago

@mo-ba It's not about mix, It's about support.