Created
March 16, 2016 20:58
-
-
Save weierophinney/c1bda9ec8c1018f15235 to your computer and use it in GitHub Desktop.
Alternate way to push middleware into the pipeline between routing and dispatch.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Zend\Expressive\Container\ApplicationFactory; | |
use Zend\Expressive\Helper; | |
return [ | |
'middleware_pipeline' => [ | |
'always' => [ | |
'middleware' => [ | |
Helper\ServerUrlMiddleware::class, | |
], | |
'priority' => 10000, | |
], | |
'routing' => [ | |
'middleware' => ApplicationFactory::ROUTING_MIDDLEWARE, | |
'priority' => 1, | |
], | |
'inbetween' => [ | |
'middleware' => [ | |
// ... | |
], | |
'priority' => 0, | |
], | |
'dispatch' => [ | |
'middleware' => ApplicationFactory::DISPATCH_MIDDLEWARE, | |
'priority' => -1, | |
], | |
'error' => [ | |
'middleware' => [ | |
], | |
'error' => true, | |
'priority' => -10000, | |
], | |
], | |
]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment