Development

- Group only loads if prefix matches (if any).
This commit is contained in:
Simon Sessingø
2016-11-06 08:13:47 +01:00
parent 035a5b1629
commit 98cc8504d4
4 changed files with 12 additions and 29 deletions
+4 -6
View File
@@ -85,16 +85,18 @@ class RouterBase {
$this->currentRoute = $route;
if($route instanceof RouterGroup && is_callable($route->getCallback())) {
if($route instanceof RouterGroup && is_callable($route->getCallback()) && $route->matchRoute($this->request)) {
$group = $route;
$group->renderRoute($this->request);
$mergedSettings = array_merge($settings, $group->getMergeableSettings());
// Add ExceptionHandler
if($group->matchRoute($this->request) && $group->getExceptionHandler() !== null) {
if($group->getExceptionHandler() !== null) {
$this->exceptionHandlers[] = $route;
}
}
$this->currentRoute = null;
@@ -476,8 +478,4 @@ class RouterBase {
return static::$instance;
}
public static function reset() {
static::$instance = null;
}
}