zend-expressive-test/config/config.php
Adrian 6aa311b35d Add UrlHelper
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)
2016-10-25 10:48:15 +02:00

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',
],
],
]);