2009年7月15日星期三

Re: [fw-mvc] howto: capture action output, stream it as pdf

Carlton Gibson-2 wrote:
>
> Okay, let's have another go. Zend_Layout's not magic. It's just
> particular. (And I'm trying to remember how it works without
> looking. :-)
>
> The idea behind this:
>> $this->_helper->ViewRenderer->render()
>
>
> was to get the content of the current action's view script into the
> Response object so that when you render the layout manually, the bit
> which goes:
>
> echo $this->layout()->content;
>
> has something to work on. That you're just getting the layout suggests
> that something has gone wrong.
>
> The old fashioned way of doing all this would be:
>
> $response = $this->getResponse();
> $response->appendBody($this->view->render(path/to/view/script.phtml));
>
> You could try that.
>

Still no good result. Now the layout html is appended to the template html.
We've lost the $this->layout()->content magic

Btw, the only method to prevent zf of outputting anything I could find is to
explicitly call

$this->getResponse()->clearBody();

So the question how Zend_Layout works is still important. The workings are
hidden to users, but we need controll over its output in a controller
action.
--
View this message in context: http://www.nabble.com/howto%3A-capture-action-output%2C-stream-it-as-pdf-tp24496539p24499486.html
Sent from the Zend MVC mailing list archive at Nabble.com.

没有评论: