2017-08-11 79 views
-1

我正在使用Symfony3.2。我想解決一個給我很多時間的錯誤。這裏是我的代碼twig.html渲染控制器在symfony中給出exeption錯誤超時

<div class="modal fade" id="helloModal" tabindex="-1" role="dialog" aria-labelledby="helloModalLabel"> 
    <div class="modal-dialog" role="document"> 
    <div class="modal-content"> 
     <div class="modal-header"> 
      <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button> 
      <h4 class="modal-title" id="helloModalLabel">Add hello</h4> 
     </div> 

     <div class="modal-body"> 
      {{ render(controller('AppBundle:Bye:editHello', {'id': '1'})) }} 
     </div> 
    </div> 
    </div> 
    </div> 

我的功能editHelloAction控制器是這樣的:

function editHelloAction($id, $Request) 
{ 
    // Do an error: instantiate unfound object. 
    $unfound = new Unfound(); 
    return new Response(); 
} 

我第一次得到這個錯誤是因爲我做了一個錯誤的寫一個東西,但在那裏我做了我的函數內的錯誤。 配置文件日誌在Symfony中不給我任何東西。他們這樣說:

Error: Maximum execution time of 30 seconds exceeded 

他們應該告訴我Unfound不是一個實體。

謝謝。

回答

0

您的請求應該寫入Request $request,而不是$Request,通常,我們寫它具有該方法的第一個參數。

你的反應不應該是空 這是毫無空響應點:documentation here

+0

它與新的響應()@Kal​​l – bsm

+0

@ysd通過「$請求」,你的意思是「請求$請求「?我不認爲在symfony中執行$ Request是有效的。 –

+0

是的請求$ request @Kall – bsm

相關問題