Cml\Http\Response::redirect PHP 메소드

redirect() 공개 정적인 메소드

重定向
public static redirect ( string $url, integer $time ) : void
$url string 重写向的目标地址
$time integer 等待时间
리턴 void
    public static function redirect($url, $time = 0)
    {
        strpos($url, 'http') === false && ($url = self::url($url, 0));
        if (!headers_sent()) {
            $time === 0 && header("Location: {$url}");
            header("refresh:{$time};url={$url}");
            exit;
        } else {
            exit("<meta http-equiv='Refresh' content='{$time};URL={$url}'>");
        }
    }