$response =Yii:: $app->response ;
设置响应码
$response->statusCode =\'404\';
设置不缓存参数
$response ->headers-> add(\'pragma\' ,\'no-cache\');
设置参数有效时间
$response -> headers-> add (\'pragma\' , \'max-age=5\');
移除参数
$response -> headers-> remove(\'pragma\' );
跳转
$response -> headers-> add (\'location\' , \'http://www.baidu.com\');
文件下载
$response ->headers-> add(\'content-disposition\' ,\'attachment;filename="a.jpg"\');
$response ->sendFile( "./b.jpg");
来自于datou:https://github.com/datou-leo/ci