-
Notifications
You must be signed in to change notification settings - Fork 327
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
New routing #591
Comments
We can't have PSR-1 and PSR-2 at this point, @WinterSilence. I would go one step further to define the interfaces for those classes.
This way we can have multiple implementations of Route:
Also, we can have multiple implementation of Router interface, one of them would be to load from config. Moreover:
Add unit tests :) Cheers! |
I don't suggest using these classes, this is only sketches. At first, we need to discuss the principles of classes. I just described my classes to highlight the major changes. |
Alright @WinterSilence. 👍 for separating router and route. |
I agree, but we need to make a list of the main methods.
I dont understand, you can write an example?
Too early for this. Add sketches for your version - interfaces and dummy-classes (empty methods) |
I was saying if we can remove this method from Request and put it where it belongs: https://github.com/kohana/core/blob/3.3/master/classes/Kohana/Request.php#L457 |
Update: added interfaces for routes (IRoute), requests (IRequest) and |
|
At this stage, discuss common issues.
My version
PSR-1, PSR-2, Namespaces
Separate classes (Router and Route).
Remove dependency (Kohana::cache, URL::site, Arr::get).
Fix and optimize methods (compile, uri, matches).
Route:
Сlass simplified for convenience and speed up: only one filter for the route, removed setters (properties sets at create). In most cases this is enough,if necessary, you can extend class.
The text was updated successfully, but these errors were encountered: