PHP Class Cml\Http\Response

Mostra file Open project: linhecheng/cmlphp Class Usage Examples

Public Methods

Method Description
redirect ( string $url, integer $time ) : void 重定向
sendContentTypeBySubFix ( string $subFix = 'html' ) 通过后缀名输出contentType
sendHttpStatus ( integer $code ) 发送http状态码相对应的信息
show404Page ( string $tpl = null ) : void 显示404页面
url ( string $url = '', integer $echo = 1 ) : string URL组装 支持不同URL模式 eg: \Cml\Http\Response::url('Home/Blog/cate/id/1')

Method Details

redirect() public static method

重定向
public static redirect ( string $url, integer $time ) : void
$url string 重写向的目标地址
$time integer 等待时间
return void

sendContentTypeBySubFix() public static method

通过后缀名输出contentType
public static sendContentTypeBySubFix ( string $subFix = 'html' )
$subFix string

sendHttpStatus() public static method

发送http状态码相对应的信息
public static sendHttpStatus ( integer $code )
$code integer 要设置的http code

show404Page() public static method

显示404页面
public static show404Page ( string $tpl = null ) : void
$tpl string 模板路径
return void

url() public static method

URL组装 支持不同URL模式 eg: \Cml\Http\Response::url('Home/Blog/cate/id/1')
public static url ( string $url = '', integer $echo = 1 ) : string
$url string URL表达式 路径/控制器/操作/参数1/参数1值/.....
$echo integer 是否输出 1输出 0 return
return string