geggleto/slim-pimple-bridge

Slim Pimple Bridge. Inject's slim's dependencies into a Pimple Container

0.1.1 2015-12-03 13:01 UTC

This package is auto-updated.

Last update: 2024-04-29 03:44:07 UTC


README

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.

Installation

composer require geggleto/slim-pimple-bridge

Usage

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);