The helper can be used to generate URLs from named routes. HomeAction was converted to a service to inject the URL helper using a factory. Also see: [Container PSR and the Service Locator](https://github.com/php-fig/fig-standards/blob/master/proposed/container-meta.md#4-recommended-usage-container-psr-and-the-service-locator)
21 lines
572 B
PHP
21 lines
572 B
PHP
<?php return new ArrayObject([
|
|
'middleware_pipeline' => [
|
|
Zend\Expressive\Container\ApplicationFactory::ROUTING_MIDDLEWARE,
|
|
['middleware' => Zend\Expressive\Helper\UrlHelperMiddleware::class],
|
|
Zend\Expressive\Container\ApplicationFactory::DISPATCH_MIDDLEWARE,
|
|
],
|
|
'routes' => [
|
|
[
|
|
'path' => '/',
|
|
'middleware' => Test\App\HomeAction::class,
|
|
'allowed_methods' => [ 'GET' ],
|
|
'name' => 'home',
|
|
],
|
|
[
|
|
'path' => '/test/another/path',
|
|
'middleware' => Test\App\HomeAction::class,
|
|
'allowed_methods' => [ 'GET' ],
|
|
'name' => 'other',
|
|
],
|
|
],
|
|
]);
|