PHP-DI / Slim-Bridge

PHP-DI integration with the Slim framework
http://php-di.org/doc/frameworks/slim.html
MIT License
176 stars 38 forks source link

example of how to add definition per module? #50

Closed rabih9780 closed 5 years ago

rabih9780 commented 5 years ago

I am building an app that consist of multiple modules. I have a master file that contains all the definitions for the container.

But I want to have a definition file per module (override previously loaded definitions). is that possible with this library? any example on how to do that?

mnapoli commented 5 years ago

Hi, yes it is definitely possible. That's actually PHP-DI's main strength ;)

Have a look here: http://php-di.org/doc/definition-overriding.html

There is also https://github.com/PHP-DI/Kernel that may be helpful, but it isn't required to use this. I use it for my own projects mainly.