This repository was archived by the owner on Jan 29, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,31 @@ All notable changes to this project will be documented in this file, in reverse
12
12
- [ #36 ] ( https://github.com/zendframework/zend-mvc/pull/36 ) adds more than a
13
13
dozen service factories, primarily to separate conditional factories into
14
14
discrete factories.
15
+ - [ #32 ] ( https://github.com/zendframework/zend-mvc/pull/32 ) adds
16
+ ` Zend\Mvc\MiddlewareListener ` , which allows dispatching PSR-7-based middleware
17
+ implementing the signature `function (ServerRequestInterface $request,
18
+ ResponseInterface $response)`. To dispatch such middleware, point the
19
+ ` middleware ` "default" for a given route to a service name or callable that
20
+ will resolve to the middleware:
21
+
22
+ ``` php
23
+ [ 'router' => 'routes' => [
24
+ 'path' => [
25
+ 'type' => 'Literal',
26
+ 'options' => [
27
+ 'route' => '/path',
28
+ 'defaults' => [
29
+ 'middleware' => 'ServiceNameForPathMiddleware',
30
+ ],
31
+ ],
32
+ ],
33
+ ]
34
+ ```
35
+
36
+ This new listener listens at the same priority as the ` DispatchListener ` , but,
37
+ due to being registered earlier, will invoke first; if the route match does
38
+ not resolve to middleware, it will fall through to the original
39
+ ` DispatchListener ` , allowing normal ZF2-style controller dispatch.
15
40
16
41
### Deprecated
17
42
You can’t perform that action at this time.
0 commit comments