Redirect

This method prepares the response object to return an HTTP Redirect response
to the client.

@param string $url    The redirect destination
@param int    $status The redirect HTTP status code
@api
506734
public function redirect($url, $status = 302)
    {
        $this->setStatus($status);
        $this->headers->set('Location', $url);
    }
92392
public static function setResponseStatus(int $status) : void
    {
        if (array_key_exists($status, Http::$http_status_messages)) {
            header('HTTP/1.1 ' . $status . ' ' . Http::$http_status_messages[$status]);
        }
    }
1061425
protected function _redirect(Subject $subject, $url = null, $status = null)
    {
        $url = $this->_redirectUrl($url);

        $subject->url = $url;
        $subject->status = $status;
        $event = $this->_trigger('beforeRedirect', $subject);

        if ($event->isStopped()) {
            return $this->_controller()->response;
        }

        return $this->_controller()->redirect($subject->url, $subject->status);
    }
339284
public function redirect($url, $status = StatusCode::FOUND)
    {
        return $this->withStatus($status)->withHeader('location', $url);
    }
558635
public function withRedirect($url, $status = null)
        {
            $response = $this->withHeader('Location', (string)$url);
            if (is_null($status) && $this->getStatusCode() === 200) {
                $status = 302;
            }
            if (!is_null($status)) {
                return $response->withStatus($status);
            }
            return $response;
        }
948836
public function redirect($uri, int $statusCode = 302): self
    {
        $this->headers->location($uri);
        return $this->fixateCode($statusCode);
    }
261318
public function redirect($location, $statusCode = 302) {
        $this->response->setHeader('Location', $location, true, $statusCode);
        return $this;
    }
89784
protected function redirect($location, $status = 302, $headers = array()) {
		// Check if a output action has be already performed
		$this->_checkIfPerformed();

		// Create a redirect
		$redirectResponse = \Symfony\Component\HttpFoundation\RedirectResponse::create($location, $status, $headers);

		// Add request informationen
		$redirectResponse->prepare($this->application->requestStack->getCurrentRequest());

		// Replace response object
		$this->application->response = $redirectResponse;

		// Don't use a template
		$this->useTemplate(false, $status);
	}
152809
def redirect(self, url, status=None):
        
        self.status_code = 302 if status is None else status
        self.headers = Headers([('location', url)])
        self.message = ''
        self.end()
1180450
protected function redirectToRoute(string $route, $parameters = [], int $status = 302): RedirectResponse
    {
        return $this->redirect($this->generateUrl($route, $parameters), $status);
    }
172140
public static function createRedirect($url, $statusCode = Response::HTTP_FOUND, array $headers = [])
    {
        $view = static::create(null, $statusCode, $headers);
        $view->setLocation($url);

        return $view;
    }
221002
public function redirect($url, $status = 302)
    {
        $this->_headers['Location'] = (string) $url;
        $this->_status = (integer) $status;

        return $this;
    }
385895
protected function redirectJsonAction($url): ServiceResponse
    {
        if (is_array($url)) {
            $url = $this->prepareUrl($url);
        }
        $response = [
            'code' => 'success',
            'data' => [
                'inDialog' => $this->request->is('dialog') && !$this->FrontendBridge->_closeDialog,
                'redirect' => $url
            ]
        ];
        return new ServiceResponse($response);
    }
874322
public function redirect($url, $statusCode = 302)
    {
        $context = Context::getInstance();

        header(HTTPToolkit::statusCodeHeader($statusCode));
        header(HTTPToolkit::locationHeader($url));

        throw new InterruptedActionException(
            'Interrupted action after a redirection',
            $context->getModuleName(),
            $context->getActionName()
        );
    }
1237007
public function redirect($url = ':self', $status = 302)
    {
        $scheme = parse_url($url, PHP_URL_SCHEME);
        if (isset($scheme)) {
            return parent::redirect($url, $status);
        }
        if ($url === ':self') {
            $app = \Slim\Slim::getInstance();
            $url = $app->request->getResourceUri();
        }
        $url = \Bono\Helper\URL::site($url);

        return parent::redirect($url, $status);
    }
1210967
public static void redirect(HttpServletRequest request, HttpServletResponse response,
                               String url) throws IOException {
        String redirectUrl;

        if (url.startsWith("/")) {
            redirectUrl = request.getContextPath() + url;
        } else {
            redirectUrl = url;
        }

        logger.debug("Redirecting to URL: {}", redirectUrl);

        response.sendRedirect(redirectUrl);
    }
206656
public function redirectToAction($action, $parameters = array(), $status = 302, $headers = array())
	{
		return $this->redirector->action($action, $parameters, $status, $headers);
	}