chakroun yesser
chakroun yesser

Reputation: 1497

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?!

Upvotes: 6

Views: 2572

Answers (1)

pzach
pzach

Reputation: 21

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();

Upvotes: 2

Related Questions