-
-
Notifications
You must be signed in to change notification settings - Fork 133
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
Attribute routes example #579
base: master
Are you sure you want to change the base?
Conversation
PR Summary
|
Nice. That should at least go into cookbook. |
->onAnyChange(function (string $type, string $path) { | ||
echo sprintf('File changed: "%s".', $path) . PHP_EOL; | ||
echo 'Run watcher-build...' . PHP_EOL; | ||
`php watcher-build.php`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't it disabled by default?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Disabled what?
@@ -36,11 +37,22 @@ | |||
use Yiisoft\Yii\RateLimiter\LimitRequestsMiddleware; | |||
use Yiisoft\Yii\RateLimiter\Storage\StorageInterface; | |||
|
|||
$routes = []; | |||
foreach (Attributes::findTargetMethods(Route::class) as $method) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about classes and groups?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's just an example. If we want to merge it I'll migrate all routes and add groups and classes
In development I just run the worker in console
php watcher.php
and it rebuild the attributes map as fast as possible:Related: yiisoft/router#194