Whisher
Whisher

Reputation: 32726

Zend Framework get the body html response from an action

I want to get the body html response form a controller action but with this code $response = $this->getResponse(); Zend_Debug::dump($response->getBody()); I've got an empty string so I'm wondering what's the problem :(

Thanks in advance.

Upvotes: 0

Views: 802

Answers (1)

josegil
josegil

Reputation: 365

If you are doing that in your controller, the body it's yet empty. If you want to get the response html of the body, you can use:

$this->view->layout()->disableLayout();

In your action. With that, you can get the response html as the response of your controller.

Upvotes: 3

Related Questions