public function forward($uri, $method = Request::METHOD_GET)
    {
        if ('cli' === PHP_SAPI) {
            throw new BaseException('You can not call forward method in cli mode.');
        }

        $request = $this->getRequest()->withMethod($method);

        $this->getContainer()->setShared('request', $request);

        $oldRouter = $this->getRouter();

        $oldRequestUri = $_SERVER['REQUEST_URI'];
        $oldGetUrl = $_GET['_url'];
        $_GET['_url'] = $_SERVER['REQUEST_URI'] = $uri;
        $this->getContainer()->setShared('router', new Router());
        $this->getRouter()->setPrefix($oldRouter->getPrefix());
        $this->getRouter()->handle($uri);

        $dispatcher = new Dispatcher();
        $response = $dispatcher->setAction($this->getRouter()->getAction())
            ->setActionNamespace($this->getRouter()->getActionNamespace())
            ->setBundle($this->getRouter()->getBundle())
            ->setParams($this->getRouter()->getParams())
            ->setResponderNamespace($this->getRouter()->getResponderNamespace())
            ->setRouteMatched($this->getRouter()->isMatched())
            ->dispatch($request);

        // restore latest state
        $this->getContainer()->setShared('router', $oldRouter);
        $_SERVER['REQUEST_URI'] = $oldRequestUri;
        $_GET['_url'] = $oldGetUrl;

        return $response;
    }