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