Giter Club home page Giter Club logo

slimnettebridge's Introduction

Oops/SlimNetteBridge

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.

Usage

Register the extension in your config file.

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

Then configure it:

slim:
    settings:
        addContentLengthHeader: false
    configurators:
        - 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:

<?php

// 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
$container->getByType(Slim\App::class)->run();

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

slimnettebridge's People

Contributors

jiripudil avatar radimvaculik avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.