final public function forward($path, $query=null)
    {
        $this->stop();
        
        $parts = parse_url($path);
        $path  = $parts['path'];
        $pathQuery = isset($parts['query']) ? $parts['query'] : null;
        
        if (strpos($path, '/') === 0) {
            $controller = Ioc::web()->getController($path);
        } else {
            $controller = $this->getModule()->getController($path);
        }
        
        if (!$controller) {
            $this->request = $this->request->withUri(Uri::createFromString($path));
            
            return $this->notFound();
        }
        
        if ($pathQuery && is_string($pathQuery)) {
            parse_str($pathQuery, $pathQuery);
        }
        if ($query && is_string($query)) {
            parse_str($query, $query);
        }
        $query = array_merge((array)$pathQuery, (array)$query);
        
        if ($query) {
            $this->request = $this->request->withQueryParams($pathQuery);
        }
        
        return $controller->handle($this->request, $this->response);
    }
final public function forward($path, $query=null)
    {
        $this->stop();
        
        $parts = parse_url($path);
        $path  = $parts['path'];
        $pathQuery = isset($parts['query']) ? $parts['query'] : null;
        
        if (strpos($path, '/') === 0) {
            $controller = Ioc::web()->getController($path);
        } else {
            $controller = $this->getModule()->getController($path);
        }
        
        if (!$controller) {
            $this->request = $this->request->withUri(Uri::createFromString($path));
            
            return $this->notFound();
        }
        
        if ($pathQuery && is_string($pathQuery)) {
            parse_str($pathQuery, $pathQuery);
        }
        if ($query && is_string($query)) {
            parse_str($query, $query);
        }
        $query = array_merge((array)$pathQuery, (array)$query);
        
        if ($query) {
            $this->request = $this->request->withQueryParams($pathQuery);
        }
        
        return $controller->handle($this->request, $this->response);
    }
final public function forward ( $ path , $ query = null ) { $ this -> stop ( ) ; $ parts = parse_url ( $ path ) ; $ path = $ parts [ 'path' ] ; $ pathQuery = isset ( $ parts [ 'query' ] ) ? $ parts [ 'query' ] : null ; if ( strpos ( $ path , '/' ) === 0 ) { $ controller = Ioc :: web ( ) -> getController ( $ path ) ; } else { $ controller = $ this -> getModule ( ) -> getController ( $ path ) ; } if ( ! $ controller ) { $ this -> request = $ this -> request -> withUri ( Uri :: createFromString ( $ path ) ) ; return $ this -> notFound ( ) ; } if ( $ pathQuery && is_string ( $ pathQuery ) ) { parse_str ( $ pathQuery , $ pathQuery ) ; } if ( $ query && is_string ( $ query ) ) { parse_str ( $ query , $ query ) ; } $ query = array_merge ( ( array ) $ pathQuery , ( array ) $ query ) ; if ( $ query ) { $ this -> request = $ this -> request -> withQueryParams ( $ pathQuery ) ; } return $ controller -> handle ( $ this -> request , $ this -> response ) ; }
forward the uri
@param  string $path
@param  string|array $query
@return ResponseInterface
forward the uri