mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-07-10 23:52:14 +00:00
Bugfixes
- Fixed rewrite from ExceptionHandler sometimes not working correctly. - Fixed default-namespace for Group and partial groups.
This commit is contained in:
@@ -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