yiisoft / file-router
基于文件的路由器
dev-master
2024-08-18 20:31 UTC
Requires
- php: ^8.1
- ext-mbstring: *
- psr/http-message: ^1.0|^2.0
- psr/http-server-handler: ^1.0
- psr/http-server-middleware: ^1.0
- yiisoft/middleware-dispatcher: ^5.2
Requires (Dev)
- httpsoft/http-message: ^1.1
- httpsoft/http-response: ^1.1
- maglnet/composer-require-checker: ^4.7
- phpunit/phpunit: ^10.5
- rector/rector: ^1.0.0
- roave/infection-static-analysis-plugin: ^1.34
- spatie/phpunit-watcher: ^1.23
- vimeo/psalm: ^5.16
- yiisoft/test-support: ^3.0
This package is auto-updated.
Last update: 2024-09-22 14:03:00 UTC
README
Yii 文件路由器
该包提供了一种基于约定的路由中间件,它根据命名空间和类名选择控制器。
要求
- PHP 8.1 或更高版本。
安装
可以使用 Composer 安装此包
composer require yiisoft/file-router
通用用法
-
将
\Yiisoft\FileRouter\FileRouter
添加到应用程序配置中web/params.php
的中间件列表中return [ 'middlewares' => [ // ... \Yiisoft\FileRouter\FileRouter::class, // or [ 'class' => FileRouter::class, 'withNamespace()' => ['MyApp\\Package1'], 'withDefaultControllerName()' => ['Default'], ], // ... ] ];
-
根据需要配置路由器。
文档
有关更多信息,请查看以下文档
如果您需要帮助或有任何问题,请访问 Yii 论坛。您还可以查看其他 Yii 社区资源。
许可
Yii 文件路由器是免费软件。它根据 BSD 许可证发布。有关更多信息,请参阅 LICENSE
。
由 Yii 软件 维护。