wshafer/expressive-symfony-router

该软件包已被放弃且不再维护。作者建议使用 wshafer/mezzio-symfony-router 软件包代替。

dev-master 2020-03-23 12:25 UTC

This package is auto-updated.

Last update: 2020-03-23 12:25:15 UTC


README

Build Status Scrutinizer Code Quality codecov

Symfony 路由 提供与 Expressive 的集成。

安装

使用 composer 安装此库

$ composer require symfony/routing:dev-master
$ composer require wshafer/expressive-symfony-router:dev-master

文档

配置

要使用 Expressive Skeleton 启用此路由器,请确保将 WShafer\Expressive\Symfony\Router\ConfigProvider::class 添加到位于 config/config.phpConfigAggregator 中。此外,您还需要删除在设置期间安装的当前路由器的配置提供程序。

路由

$app->route('/book/{id}', YourRequestHandler::class)

缓存

要启用缓存,您需要添加以下配置


return [
    'router' => [
        'symfony' => [
            'cache_enabled' => true,
            'cache_file'    => /my/cache/dir/cache_file.txt
        ],
    ],
];