改名
This commit is contained in:
@@ -261,8 +261,13 @@ class Node extends HttpService
|
||||
*/
|
||||
public function addChild(Node $node, string $field): Node
|
||||
{
|
||||
$this->childes[] = $node;
|
||||
return $node;
|
||||
/** @var Node $oLod */
|
||||
$oLod = $this->childes[$field] ?? null;
|
||||
if (!empty($oLod)) {
|
||||
$node = $oLod;
|
||||
}
|
||||
$this->childes[$field] = $node;
|
||||
return $this->childes[$field];
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -145,7 +145,7 @@ class Router extends HttpService implements RouterInterface
|
||||
{
|
||||
[$first, $explode] = $this->split($path);
|
||||
if (!isset(static::$nodes[$method]['/'])) {
|
||||
static::$nodes[$method][$first] = $this->NodeInstance('/', 0, $method);
|
||||
static::$nodes[$method]['/'] = $this->NodeInstance('/', 0, $method);
|
||||
}
|
||||
|
||||
$parent = static::$nodes[$method]['/'];
|
||||
|
||||
Reference in New Issue
Block a user