设置服务器端重定向
默认状态码为302
@param string $url
@param int $status
@return static
339284
public function redirect($url, $status = StatusCode::FOUND)
    {
        return $this->withStatus($status)->withHeader('location', $url);
    }
497816
public function redirect($route, $parameters = array(), $status = 302, $headers = array())
    {
        return Redirect::route('admin.'.$route, $parameters, $status, $headers);
    }
554426
public function back($status = 302, $headers = array())
	{
		$back = $this->generator->previous();

		return $this->createRedirect($back, $status, $headers);
	}
1304944
public function to($path, $status = 302, $headers = [], $secure = null)
    {
        $path = $this->app->make('url')->to($path, [], $secure);

        return $this->createRedirect($path, $status, $headers);
    }
5107
public function status($status = 0, array $url = [], $icon = 'circle')
    {
        $class = (int) $status === 1 ? 'ck-green' : 'ck-red';
        if (count($url) === 0) {
            return $this->icon($icon, ['class' => $class]);
        }

        return $this->link(null, 'javascript:void(0);', [
            'icon'     => $icon,
            'class'    => $class,
            'data-url' => $this->Url->build($url)
        ]);
    }
523001
public function setStatus($status) {
        if (!is_int($status)) throw new IllegalTypeException('Illegal type of parameter $status: '.gettype($status));
        if ($status < 1)      throw new InvalidArgumentException('Invalid argument $status: '.$status);

        $this->status = $status;
        return $this;
    }
952985
public static function SetStatus(int $status, bool $exit = false) :void
        {
            if (!HttpStatusCode::IsSupported($status)) {
                throw new \Error("Status code {$status} is not supported");
            }

            self::$status = $status;
            self::AddHeader('Status', $status);

            if ($exit) {
                self::ApplyHeaders();
                exit();
            }
        }
1088425
public function redirect ($url, $statusCode = 302)
		{
			parent::redirect($url, $statusCode);
			Yii::$app->end();
		}
1199699
protected function redirectView($url, $statusCode = Response::HTTP_FOUND, array $headers = [])
    {
        return View::createRedirect($url, $statusCode, $headers);
    }
321096
public function redirect($url, $statusCode = 302) {
		$this->setStatusCode($statusCode)
			->setHeader('Location', $url)
			->setBody(sprintf('<!DOCTYPE html>
<meta charset="UTF-8">
<meta http-equiv="refresh" content="1;url=%1$s">
<title>Redirecting to %1$s</title>
Redirecting to <a href="%1$s">%1$s</a>', htmlspecialchars($url, ENT_QUOTES, 'UTF-8')));

		return $this;
	}
1313368
public function status($status = null)
        {
            if (is_null($status)) {
                return $this->foundation->getStatusCode();
            } else {
                $this->foundation->setStatusCode($status);

                return $this;
            }
        }
1000126
public function setStatus($status)
	{
		$status = (int)$status;

		if($status < 100)
		{
			throw new \InvalidArgumentException(sprintf('Invalid HTTP status code: %u', $status));
		}
		
		if($status >= 600)
		{
			throw new \InvalidArgumentException(sprintf('Invalid HTTP status code: %u', $status));
		}
		
		$this->status = $status;
		
		return $this;
	}
1221877
public function redirect($url = null, $statusCode = 302, $options = array())
    {
        $this->setStatusCode($statusCode);
        $this->setOption($options);

        // The variables for custom redirect view
        $escapedUrl = htmlspecialchars($url, ENT_QUOTES, 'UTF-8');
        $wait = (int)$this->redirectWait;

        // Location header does not support delay
        if (0 === $wait) {
            $this->setHeader('Location', $url);
        }

        // Prepare response content
        if ($this->redirectView) {
            ob_start();
            require $this->redirectView;
            $content = ob_get_clean();
        } else {
            $content = sprintf('<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta http-equiv="refresh" content="%d;url=%2$s">
    <title>Redirecting to %s</title>
  </head>
  <body>
    <h1>Redirecting to <a href="%2$s">%2$s</a></h1>
  </body>
</html>', $wait, $escapedUrl);
        }

        return $this->setContent($content);
    }
948836
public function redirect($uri, int $statusCode = 302): self
    {
        $this->headers->location($uri);
        return $this->fixateCode($statusCode);
    }
206656
public function redirectToAction($action, $parameters = array(), $status = 302, $headers = array())
	{
		return $this->redirector->action($action, $parameters, $status, $headers);
	}
664165
public function setStatus($status) {

        if ( !in_array($status, range(0, 3)) ) throw new InvalidArgumentException("Invalid status $status");

        $this->status = $status;

        return $this;

    }
830556
final public static function redirect(
        string $url,
        array $query = array(),
        bool $domain = true,
        int $status = 302
    ) {
        $newurl = $url;
        $iterator = 0;
        $domainstring = "";
        foreach ($query as $one => $value) {
            $newurl .= ((0 === $iterator)? "?" : "")."$one=$value".((count($query) === $iterator + 1)? "" : "&");
        }
        if (true === $domain) {
            $server = new GlobalServer();
            $https = ((null !== $server->get("HTTPS") &&
                "on" === $server->get("HTTPS"))? "https://" : "http://");
            $domainstring = $https.$server->get("HTTP_HOST");
        }

        if (isset($newurl[0]) && $newurl[0] !== "/") {
            $newurl = "/".$newurl;
        }
 
        header("Location: $domainstring$newurl", true, $status);
        exit(1);
    }