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

  • 關於本站
  • 免責聲明