mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-06-17 00:37:52 +00:00
@@ -510,6 +510,7 @@ class Router
|
||||
$this->debug('Finished rendering exception-handler');
|
||||
|
||||
if (isset($this->loadedExceptionHandlers[$key]) === false && $this->request->hasPendingRewrite() === true) {
|
||||
|
||||
$this->loadedExceptionHandlers[$key] = $handler;
|
||||
|
||||
$this->debug('Exception handler contains rewrite, reloading routes');
|
||||
@@ -519,6 +520,10 @@ class Router
|
||||
'rewriteRoute' => $this->request->getRewriteRoute(),
|
||||
]);
|
||||
|
||||
if ($this->request->getRewriteRoute() !== null) {
|
||||
$this->processedRoutes[] = $this->request->getRewriteRoute();
|
||||
}
|
||||
|
||||
return $this->routeRequest();
|
||||
}
|
||||
|
||||
|
||||
@@ -256,6 +256,7 @@ class SimpleRouter
|
||||
$group = new RouteGroup();
|
||||
$group->setCallback($callback);
|
||||
$group->setSettings($settings);
|
||||
$group = static::addDefaultNamespace($group);
|
||||
|
||||
static::router()->addRoute($group);
|
||||
|
||||
@@ -283,6 +284,7 @@ class SimpleRouter
|
||||
$group = new RoutePartialGroup();
|
||||
$group->setSettings($settings);
|
||||
$group->setCallback($callback);
|
||||
$group = static::addDefaultNamespace($group);
|
||||
|
||||
static::router()->addRoute($group);
|
||||
|
||||
@@ -511,6 +513,12 @@ class SimpleRouter
|
||||
{
|
||||
if (static::$defaultNamespace !== null) {
|
||||
|
||||
if ($route instanceof IGroupRoute) {
|
||||
$route->setNamespace(static::$defaultNamespace . '\\' . ltrim($route->getNamespace(), '\\'));
|
||||
|
||||
return $route;
|
||||
}
|
||||
|
||||
$callback = $route->getCallback();
|
||||
|
||||
/* Only add default namespace on relative callbacks */
|
||||
|
||||
Reference in New Issue
Block a user