-
Notifications
You must be signed in to change notification settings - Fork 16
Added a router listener #5
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
Conversation
This implementation caches the response from the router. It requires Any comments? |
Do we need the query params in the cache key? |
$request = $event->getRequest(); | ||
|
||
if (!$request->attributes->has('_controller')) { | ||
// routing has not taken place |
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.
if it has controller, i think routing HAS taken place, no?
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.
You missed the "!".
If NOT the $request has _controller, no routing has taken place
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.
Derp, i thought this was in onBeforeRouting for some reason.
Done! |
This caches all the result for the router to be used for later.
TODO: We need to improve the cache key.