Get RedirectResponse by route

@param string $route
@param array  $parameters
@param int    $referenceType
@param int    $status

@return RedirectResponse
972644
public function getRedirectToRoute($route, $parameters = [], $referenceType = UrlGeneratorInterface::ABSOLUTE_PATH, $status = Response::HTTP_FOUND, $routeFragment = null)
    {
        $url = $this->getRouter()->generate($route, $parameters, $referenceType);
        if (null !== $routeFragment) {
            $url = sprintf('%s#%s', $url, $routeFragment);
        }

        return new RedirectResponse($url, $status);
    }
172140
public static function createRedirect($url, $statusCode = Response::HTTP_FOUND, array $headers = [])
    {
        $view = static::create(null, $statusCode, $headers);
        $view->setLocation($url);

        return $view;
    }
311297
public function dispatchRoute(Parsed $route, array $parameters = [])
    {
        $handler = $route->getHandler();
        if (isset($handler['controler']) && isset($handler['action'])) {
            $routePlaceholders             = $route->getPlaceholders();
            list($controllerName, $action) = $this->resolveControlerAction(
                $route->getParameters(),
                $routePlaceholders,
                $handler
            );

            // Create instance of target class
            $controller = new $controllerName();
            // Create class method name with prefix
            $methodName = $this->actionName.$action;

            $parameterMap = $this->getMethodParameters(
                $controllerName,
                $methodName
            );

            $methodParameters = $this->getFunctionArgumentsControlers(
                $parameterMap,
                $route->getParameters(),
                $routePlaceholders,
                $handler
            );

            return call_user_func_array(
                [
                    $controller,
                    $methodName
                ],
                $methodParameters
            );
        }

        return $this->dispatchNotFound();
    }
675414
public function dispatchRoute(Parsed $route, array $parameters = [])
    {
        $handler = $route->getHandler();
        if ($this->isClosure($handler)) {
            $paramMap  = $this->getFunctionArgumentsNames($handler);
            $arguments = $this->getFunctionArguments(
                $paramMap,
                $route->getParameters(),
                $route->getPlaceholders()
            );

            return call_user_func_array($handler, $arguments);
        }

        return $this->dispatchNotFound();
    }
252682
protected function redirectTo($route, array $parameters = [])
    {
        $url = $this->url->toRoute($route, $parameters);

        return $this->makeRedirect($url);
    }
798716
public function redirect($route, $parameters = [], $status = 302)
    {
        return $this->application->redirect($this->path($route, $parameters), $status);
    }
1186269
public function redirect($path, $status = 301)
    {
        if (!$this->asWidget) {
            /** @var ResponseInterface $response */
            $response = (new ResponseInjector)->build();
            if (!$response) {
                throw new Exception('Component `response` not configured');
            }

            $response = $response->withStatus($status);
            $response = $response->getHeaderLine('Location: '.$path);

            return $response;
        }

        return false;
    }
867111
private function call(ServerRequestInterface $serverRequest, Route $route)
    {
        ob_start();

        try {
            $result = call_user_func(
                [
                    $this->container->resolve($route->getClass(), null),
                    $route->getMethod()
                ],
                new Request(
                    $serverRequest,
                    $this->container->get(ResponseFactoryInterface::class),
                    $this->container->get(ViewFactory::class),
                    $route
                )
            );

            if ($result instanceof ResponseInterface) {
                $response = $result;
            } else {
                $output = ob_get_contents();

                $response = $this->responseFactory->createResponse(200);
                $response->getBody()->write($result === null ? (string)$output : (string)$result);
            }

            ob_end_clean();
        } catch (\Exception $e) {
            ob_end_clean();
            throw $e;
        }

        return $this->addHeaders($response, $route);
    }
1157652
protected function createRedirect( $path, $status, $headers )
	{
		$redirect = new RedirectResponse( $path, $status, $headers );

		if ( isset( $this->session ) )
			$redirect->setSession( $this->session );

		$redirect->setRequest( $this->generator->getRequest() );

		return $redirect;
	}
1165717
public function callbackFunction($route = null, $parameters = [])
    {
        if ($route === null || ! is_string($route)) {
            // Gets URI from current request
            $uri = $this->request->getUri();
        } else {
            // Generates URI from '_route'
            $uri = $this->router->generate(
                $route,
                $parameters,
                Router::ABSOLUTE_URL
            );
        }

        $result = parse_url($uri);

        // When uri contains query string
        if (isset($result['query'])) {

            parse_str($result['query'], $query);

            // Remove callback from query
            $query = array_diff_key($query, ['callback' => null]);
        } else {
            // Return unchanged uri
            return $uri;
        }

        return $result['scheme'].'://'.
               (isset($result['user']) ? $result['user'] : '').
               (isset($result['pass']) ? ':'.$result['pass'].'@' : '').
               $result['host'].
               (isset($result['port']) ? ':'.$result['port'] : '').
               (isset($result['path']) ? $result['path'] : '').
               ($query != [] ? '?'.http_build_query($query) : '').
               (isset($result['fragment']) ? '#'.$result['fragment'] : '');
    }
1102046
protected function redirect($url, $statusCode = 302)
    {
        $response = new RedirectResponse($url, $statusCode);
        $this->getServiceLocator()->set('Response', $response);

        return $response;
    }
1000463
public function route($route, $parameters = [], $status = 302, $headers = [])
    {
        $path = $this->app->make('url')->route($route, $parameters);

        return $this->to($path, $status, $headers);
    }
1367305
public function redirect($uri, $destination, $status = 302)
    {
        return $this->any($uri, '\Illuminate\Routing\RedirectController')
                ->defaults('destination', $destination)
                ->defaults('status', $status);
    }
359491
protected function redirect(Response $response, $route, array $params = [])
    {
        return $response->withRedirect($this->container['router']->pathFor($route, $params));
    }
1207211
public function redirectRoute($name, $params = [], $statusCode = 302) {
		$this->redirect($this->urlGenerator->generate($name, $params), $statusCode);
		return $this;
	}
400690
public function redirectToRoute($route, array $params = [], $permanent = false)
    {
        $map = $this->app()->getRouteMap();
        $url = $map->assemble($route, $params);

        return $this->redirect($url, $permanent);
    }
518229
public function redirect($url, array $params = [], $status = 302)
    {
        if (!empty($params)) {
            $url = rtrim(preg_replace('/\?.*/', '', $url), '/');
            $url .= "?" . http_build_query($params);
        }

        $this->statusCode = $status;
        $this->headers->set('Location', $url);

        $this->getMbAudit()->setResponseType('redirect');
        $this->getMbAudit()->setResponseData([
            'url' => $url,
        ]);

        return true;
    }