Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Symfony2 | Hide/remove Header From response/forward

I'm trying to put 2 Controller result in one controller, so I forward in the first one using '$response = $this->forward('Bundle:Controller:functionXXX');'.

in thecontroller ' functionXXXAction' I return response using renderView.

The problem is that the forward function return this header in the top of the page:

"HTTP/1.0 200 OK Cache-Control: no-cache Date: Wed, 24 Apr 2013 09:56:50 GMT"

Any solution to hide it from the page?!

like image 268
chakroun yesser Avatar asked Apr 24 '13 10:04

chakroun yesser


1 Answers

The question is a bit old but maybe someone will be looking for an answer in the future. To get rid of the header you just need to call: $response = $this->forward('Bundle:Controller:functionXXX'); $response->getContent();

like image 82
pzach Avatar answered Nov 03 '22 02:11

pzach