The Slim-Pimple Bridge allows you to "bring your own" Pimple 3.x container to a Slim 3.x application without requiring you to refactor your existing container.
composer require geggleto/slim-pimple-bridge
The example below assumes that your Pimple\Container
instance is assigned to the
$myAwesomePimpleContainer
variable.
// Here's a default \Slim\Container.
$slimContainer = new \Slim\Container();
// Use SlimPimpleBridge::merge() to add all of the services from your container
// to the $slimContainer instance.
$container = SlimPimpleBridge::merge(
$slimContainer,
$myAwesomePimpleContainer
);
// Done! It's that easy!
$app = new \Slim\App($container);