logo
  • 教程列表
  • SO官方文档
  • 响应
    • JsonResponse
    • 简单的用法
    • 设置状态代码
    • 设置标题
  1. StackOverflow 文档
  2. symfony2 教程
  3. 响应
  4. 设置标题

设置标题

Created: November-22, 2018

请参阅 http 标头列表。

 public function someAction(){
    
    // Action's code
    $response = new Response(); 

    $response->headers->set('Content-Type', 'text/html');

    return $response; 
}
  • 设置状态代码

Copyright © 2018. All right reserved

tastones.com 备案号:鲁ICP备18045372号-1

  • 关于我们
  • 免责声明