can*_*nni 2 php httpresponse symfony
Symfony2抽象Request和Response对象,我应该如何创建Response对象,为客户端文件附件提供服务以及为浏览器显示图像?
Jul*_*cro 10
您只需使用Response对象:
use Symfony\Component\HttpFoundation\Response;
Run Code Online (Sandbox Code Playgroud)
并以这种方式设置Content-Type:
return new Response($image, 200, array('Content-Type' => 'image/png'));
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
5195 次 |
| 最近记录: |