mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-06-17 00:37:52 +00:00
[OPTIMISATION] Optimised middleware loading and routes.
This commit is contained in:
@@ -10,7 +10,7 @@ class RouterGroup extends RouterEntry {
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function matchRoute(Request $request) {
|
||||
public function renderRoute(Request $request) {
|
||||
// Check if request method is allowed
|
||||
|
||||
if(strtolower($request->getUri()) == strtolower($this->prefix) || stripos($request->getUri(), $this->prefix) === 0) {
|
||||
@@ -29,11 +29,17 @@ class RouterGroup extends RouterEntry {
|
||||
throw new RouterException('Method not allowed');
|
||||
}
|
||||
|
||||
return $this;
|
||||
$this->loadMiddleware($request);
|
||||
|
||||
return parent::renderRoute($request);
|
||||
}
|
||||
|
||||
// No match here, move on...
|
||||
return null;
|
||||
}
|
||||
|
||||
public function matchRoute(Request $request) {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user