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
Refactor container out of Router #2100
Comments
We can also add getter/setter methods to the
Same methods will be used inside of |
Another related concern are route groups, which need a resolver and they need to bind their callables to the app instance itself. |
Output buffering should be part of a view renderer not part of the router |
Can't output buffering be handled in a middleware? Users could simply register the middleware on the routes, groups, etc. that you want it on... it'd have to be registered first though I suppose. |
There's an argument that we just remove the output buffering thing altogether. We'll need to ensure that a |
I'm all for removing output buffering, but I'm not sure how you omit that and allow |
|
Something to look at… |
Explicit tasks:
|
WIP PR #2102 |
@akrabat Pretty sure the PR is ready for review. Is there anything I'm missing from the checklist above? |
Closing |
The router currently needs a reference to the app container only to bind the Route callable to the container if the callable is a
\Closure
. Each route instance currently needs the container to locate the app'sFoundHandler
strategy if available, else it falls back to a defaultRequestResponseStrategy
.We should remove the container from the router and route instance and, instead, inject the
FoundHandler
strategy into the router during router creation while also addingFoundHandler
getter/setter methods on the router should the end user wish to change it during runtime.In
App::map()
, we are setting the route's output buffering setting. This should really be encapsulated in the router, imo. We can set this preference when we instantiate the router (discovered from app settings), and the router can assign the output buffering preference to each new route inRouter::createRoute()
.These changes will completely decouple the app container from router and route instances.
The text was updated successfully, but these errors were encountered: