mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-07-08 19:00:03 +00:00
Development
- Optimized the way parameters are parsed as a result, simple-router now supports routes like `/{param1}-{param2}.json`.
- Replaced reg-ex for parameter-matching with `\w` which means that default parameter matching on routes now include `_` (underscore) per default.
- Simplified `MiddlewareTest` class.
This commit is contained in:
@@ -131,6 +131,14 @@ class RouterBase {
|
||||
// Loop through each route-request
|
||||
$this->processRoutes($this->routes);
|
||||
|
||||
// Make sure routes with longer urls are rendered first
|
||||
usort($this->controllerUrlMap, function($a, $b) {
|
||||
if(strlen($a->getUrl()) < strlen($b->getUrl())) {
|
||||
return 1;
|
||||
}
|
||||
return -1;
|
||||
});
|
||||
|
||||
$routeNotAllowed = false;
|
||||
|
||||
$max = count($this->controllerUrlMap);
|
||||
|
||||
Reference in New Issue
Block a user