i have website lots of modules/controllers/actions. trying use existing content offline pdf report.
to simplify problem, want capture content of 2 actions:
$content = [ 'first' => 'module_1/controller_1/action_1', 'second' => 'module_2/controller_2/action_2' ];
all these actions exist , generate content independently. adding requests actionstack, not sure on how execute them , gather final content.
$stack = zend_controller_action_helperbroker::getstatichelper('actionstack'); foreach ($content $key => $path){ list($module, $controller, $action) = explode("/", $path); $stack->actiontostack($action, $controller, $module) }
but not work expecting , no response. correct way capture rendered content of actions?
views helper zend_view_helper_action
can capture result of controller work
function f($action, $controller, $module, array $params = array()) { $view = zend_controller_action_helperbroker::getstatichelper('viewrenderer'); return $view->view->gethelper('action')->action($action, $controller, $module, $params); } $content = [ 'first' => 'module_1/controller_1/action_1', 'second' => 'module_2/controller_2/action_2' ]; foreach ($content $key => $path){ list($module, $controller, $action) = explode("/", $path); $content = f($action, $controller, $module) }
or try write custom function based on zend_view_helper_action
code.
Comments
Post a Comment