/** * 把指定路径的访问委托到另外一个router * * @param string $path * @param Owl\Mvc\Router $router * @return $this */ public function delegate($path, Router $router) { $path = $this->normalizePath($path); if ($base_path = $this->getConfig('base_path')) { $base_path = $base_path . ltrim($path, '/'); } else { $base_path = $path; } $router->setConfig('base_path', $base_path); $this->children[$path] = $router; return $this; }