jiji

$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

 

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2021-10-03
  • 2022-12-23
  • 2021-12-18
  • 2021-06-24
  • 2021-12-18
  • 2021-05-26
  • 2021-12-18
猜你喜欢
  • 2021-12-18
  • 2021-12-18
  • 2021-08-13
  • 2022-12-23
  • 2021-12-18
  • 2021-12-28
相关资源
相似解决方案