https://github.com/thecodingmachine/silex-middleware
This package provides a StackPHP middleware that can be used to plug a Silex application
https://github.com/thecodingmachine/silex-middleware
Last synced: 7 months ago
JSON representation
This package provides a StackPHP middleware that can be used to plug a Silex application
- Host: GitHub
- URL: https://github.com/thecodingmachine/silex-middleware
- Owner: thecodingmachine
- Created: 2015-01-27T18:07:46.000Z (almost 11 years ago)
- Default Branch: 1.0
- Last Pushed: 2015-05-12T13:30:31.000Z (over 10 years ago)
- Last Synced: 2025-06-05T23:55:04.675Z (8 months ago)
- Language: PHP
- Size: 137 KB
- Stars: 11
- Watchers: 16
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Silex middleware for StackPHP
=============================
This package contains a [StackPHP middleware](http://stackphp.com/) that unables you to push a Silex
application directly on the middleware stack. The Silex application will try to handle requests but
instead of sending a 404 response if nothing is found, the next middleware on the stack will be called.
Installation
------------
Through [Composer](https://getcomposer.org/) as [mouf/silex-middleware](https://packagist.org/packages/mouf/silex-middleware).
Usage
-----
Simply use the `SilexMiddleWare` class in your middleware stack:
```php
use Mouf\StackPhp\SilexMiddleware;
use Silex\Application;
use Stack\Builder;
$app = ...
$silex = new Silex\Application();
$silex->get('/hello', function(Request $request) {
return 'Hello World!';
});
$stack = (new Stack\Builder())
->push(SilexMiddleWare::class, $silex);
$app = $stack->resolve($app);
```