wshafer/mezzio-symfony-router

1.0.0 2020-03-23 12:43 UTC

This package is auto-updated.

Last update: 2024-09-23 22:36:29 UTC


README

Build Status Scrutinizer Code Quality codecov

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