wshafer/ mezzio-symfony-router
1.0.0
2020-03-23 12:43 UTC
Requires
- php: ^7.3
- mezzio/mezzio-router: ^3.1
- psr/container: ^1.0
- psr/http-message: ^1.0.1
- symfony/psr-http-message-bridge: ^2.0
- symfony/routing: ^5.0
Requires (Dev)
- php-coveralls/php-coveralls: ^2.0
- phpmd/phpmd: @stable
- phpunit/phpunit: ^9.0
- squizlabs/php_codesniffer: @stable
This package is auto-updated.
Last update: 2024-09-23 22:36:29 UTC
README
为Symfony Route提供Mezzio集成。
安装
使用composer安装此库
$ composer require wshafer/mezzio-symfony-router
文档
配置
要使用Mezzio Skeleton启用此路由器,请确保WShafer\Mezzio\Symfony\Router\ConfigProvider::class
已添加到位于config/config.php
中的ConfigAggregator
。此外,您可能还需要移除在设置过程中安装的当前路由器的配置提供程序。
路由
$app->route('/book/{id}', YourRequestHandler::class)
缓存
要启用缓存,您需要添加以下配置
return [ 'router' => [ 'symfony' => [ 'cache_enabled' => true, 'cache_file' => /my/cache/dir/cache_file.txt ], ], ];