I am trying to find a way to capture the output (visualized view) of another action in the current action ... something similar to output buffering.
The scenario is that I need to save a βsnapshotβ of the report. The data used in the report is constantly changing, and for some reason I need to actually save the HTML representation, not just the data array. I created snapshotAction (), and I want to somehow capture the output of a separate reportAction () inside it. I do not want to display reportAction () on the screen, I want it to be displayed in my current action before the action completes.
Is there any way to do this in ZF?
Benedict Cohen answered correctly below, but I did not understand this until I saw this use in the archives of the ZF mailing lists:
How to display several types of actions?I use something similar:
public function snapshotAction () {
$content = $this->view->action('run', 'report');
...etc...
}
source
share