Slim Framework bridge for Nette DI.

1.2.0 2019-04-15 07:51 UTC

This package is auto-updated.

Last update: 2020-06-15 10:43:55 UTC


Build Status Downloads this Month Latest stable

This package helps you quickly build a Slim Framework application, utilizing the power of Nette DI container.

Installation and requirements

$ composer require oops/slim-nette-bridge

Oops/SlimNetteBridge requires PHP >= 7.1.


Register the extension in your config file.

    slim: Oops\SlimNetteBridge\DI\SlimExtension(%debugMode%)

Then configure it:

        addContentLengthHeader: false
        - App\MyConfigurator
  • settings section can be used to override Slim's default settings;
  • configurators is a list of ApplicationConfigurator implementations which, in the same order as defined in the list, can add routes and middlewares to the instance of Slim\App.

Once you have configured the bridge, you can create a simple index.php script in your document root, using nette/bootstrap to build the container:


// include Composer autoloader
require_once __DIR__ . '/path/to/vendor/autoload.php';

// configure and create the DI container
$configurator = new Nette\Configurator();
$configurator->setTempDirectory(__DIR__ . '/path/to/temp');
$configurator->addConfig(__DIR__ . '/path/to/config.neon');
$container = $configurator->createContainer();

// run the configured Slim application

Don't forget to configure your web server to pass the incoming requests to the index.php script.