Cml\Http\Response::redirect PHP Method

redirect() public static method

重定向
public static redirect ( string $url, integer $time ) : void
$url string 重写向的目标地址
$time integer 等待时间
return 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}'>");
        }
    }