composer require weew/router-container-aware
This package integrates weew/router with weew/container and allows filters, parameter resolvers, etc. to rely on dependency injection and sharing of data trough the container.
Simply create a container aware instance of Router
and pass in an instance of IContainer
.
$commander = new Weew\Router\ContainerAware\Router(new Container());