設定狀態程式碼
public function someAction(){
// Action's code
return new Response($error, 500);
}
另一個例子:
public function someAction(){
// Action's code
$response = new Response();
$response->setStatusCode(500)
$response->setContent($content);
return $response;
}