Skip to content

Commit 6a7f5f2

Browse files
committed
Update README.md
1 parent 63434bd commit 6a7f5f2

File tree

1 file changed

+35
-1
lines changed

1 file changed

+35
-1
lines changed

Diff for: README.md

+35-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,36 @@
1-
# phpdebugbar
1+
# phpdebugbar middleware
22
PHP Debug bar middleware with PSR-7
3+
4+
This middleware provide framework-agnostic possibility to attach [PHP Debug bar](http://phpdebugbar.com/) to your response (html on non-html!).
5+
6+
## Installation
7+
8+
```json
9+
{
10+
"require": {
11+
"php-middleware/php-debug-bar": "^1.0.0"
12+
}
13+
}
14+
```
15+
16+
To build this middleware you need to injecting inside `PhpDebugBarMiddleware` instance `DebugBar\JavascriptRenderer` (you can get it from `DebugBar\StandardDebugBar`) and add middleware to your middleware runner.
17+
18+
```php
19+
$debugbar = new DebugBar\StandardDebugBar();
20+
$debugbarRenderer = $debugbar->getJavascriptRenderer();
21+
$middleware = new PhpMiddleware\PhpDebugBar\PhpDebugBarMiddleware($debugbarRenderer);
22+
23+
$app = new MiddlewareRunner();
24+
$app->add($middleware);
25+
$app->run($request, $response);
26+
```
27+
28+
## It's just works with any modern php framework!
29+
30+
Middleware tested on:
31+
* [Expressive](https://github.com/zendframework/zend-expressive)
32+
33+
Middleware should works with:
34+
* [Slim 3.x](https://github.com/slimphp/Slim)
35+
36+
And any other modern framework [supported middlewares and PSR-7](https://mwop.net/blog/2015-01-08-on-http-middleware-and-psr-7.html).

0 commit comments

Comments
 (0)