mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-07-11 19:12:13 +00:00
Bugfixes
This commit is contained in:
@@ -136,7 +136,6 @@ class RouterBase
|
|||||||
|
|
||||||
protected function processRoutes(array $routes, array $settings = array(), array $prefixes = array(), RouterEntry $parent = null)
|
protected function processRoutes(array $routes, array $settings = array(), array $prefixes = array(), RouterEntry $parent = null)
|
||||||
{
|
{
|
||||||
|
|
||||||
// Loop through each route-request
|
// Loop through each route-request
|
||||||
/* @var $route RouterEntry */
|
/* @var $route RouterEntry */
|
||||||
foreach ($routes as $route) {
|
foreach ($routes as $route) {
|
||||||
@@ -148,6 +147,10 @@ class RouterBase
|
|||||||
$route->setParent($parent);
|
$route->setParent($parent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (count($settings)) {
|
||||||
|
$route->merge($settings);
|
||||||
|
}
|
||||||
|
|
||||||
if ($route instanceof RouterGroup) {
|
if ($route instanceof RouterGroup) {
|
||||||
|
|
||||||
if ($route->getCallback() !== null && is_callable($route->getCallback())) {
|
if ($route->getCallback() !== null && is_callable($route->getCallback())) {
|
||||||
@@ -163,15 +166,10 @@ class RouterBase
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if ($route instanceof RouterGroup) {
|
|
||||||
$newPrefixes[] = trim($route->getPrefix(), '/');
|
$newPrefixes[] = trim($route->getPrefix(), '/');
|
||||||
$newSettings = array_merge($settings, $route->toArray());
|
$newSettings = array_merge($settings, $route->toArray());
|
||||||
} else {
|
|
||||||
if (count($settings)) {
|
|
||||||
$route->merge($settings);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($route instanceof ILoadableRoute) {
|
if ($route instanceof ILoadableRoute) {
|
||||||
@@ -181,7 +179,6 @@ class RouterBase
|
|||||||
}
|
}
|
||||||
|
|
||||||
$this->controllerUrlMap[] = $route;
|
$this->controllerUrlMap[] = $route;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (count($this->backStack) > 0) {
|
if (count($this->backStack) > 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user