You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This project is a very simple extension to the Silex microframework.
It makes Silex able to use any other dependency container compatible with container-interop (and not only Pimple).
To use this, you simply need to use the Mouf\Interop\Silex\Application class that extends the Silex\Application class.
Why?
Silex is a microframework. It is designed on top of Pimple, a very simple dependency injection container
(DIC) written in about 80 lines of code.
Pimple is a nice DIC, but it can become quite verbose as your project grows. And natively, Silex
has no way to use another DIC (the Application class of Silex extends the Pimple class).
This project lets you add any other dependency injection framework
directly in your Silex project. Instead of injecting your dependencies by filling the $app variable,
you can register entries in your own container. Instances declared in your container will be accessible using the
Pimple $app['my.instance'] syntax.
How?
The extended Application class has a modified constructor:
There is a very similar package for Symfony 2 application. It lets you add additional containers to
the main Symfony 2 container: check it out: interop.symfony.di
About
This project is a very simple extension to the Silex microframework. It adds to Silex the capability to use any DI container (not only Pimple).