Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define that file router is better to be placed after regular router i… #26

Merged
merged 4 commits into from
Jan 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ Since Yii 3 consists of many packages, we have a [special development tool](http
If you don't have any particular package in mind to start with:

- [Check roadmap](https://github.com/yiisoft/docs/blob/master/003-roadmap.md).
- Check package issues at github. Usually there are some.
- Check package issues at GitHub. Usually there are some.
- Ask @samdark.
2 changes: 1 addition & 1 deletion .github/SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
Please use the [security issue form](https://www.yiiframework.com/security) to report to us any security issue you
find in Yii. DO NOT use the issue tracker or discuss it in the public forum as it will cause more damage than help.

Please note that as a non-commercial OpenSource project we are not able to pay bounties at the moment.
Please note that as a non-commercial OpenSource project, we are not able to pay bounties at the moment.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ composer require yiisoft/file-router
return [
'middlewares' => [
// ...
Router::class,
\Yiisoft\FileRouter\FileRouter::class,
// or
[
Expand All @@ -49,7 +50,10 @@ composer require yiisoft/file-router
];
```

2. [Configure the router](docs/guide/en#configuration) for your needs.
2. [Configure the file router](docs/guide/en#configuration) for your needs.

> Note: `FileRouter` goes after regular `Router` to serve as a fallback in case explicitly defined route
is not found.

By default, the following structure of the app could be used assuming `App` points to `src` directory:

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "yiisoft/file-router",
"type": "library",
"description": "File based router",
"description": "Convention-based file structure router",
"keywords": [
"file-router",
"router",
Expand Down
2 changes: 1 addition & 1 deletion config/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
use Yiisoft\Middleware\Dispatcher\MiddlewareFactory;

return [
FileRouter::class => function (ContainerInterface $container) {
FileRouter::class => static function (ContainerInterface $container) {
$eventDispatcher = $container->has(EventDispatcherInterface::class)
? $container->get(EventDispatcherInterface::class)
: null;
Expand Down
Loading