/ Published in: PHP
Zend View Action Helpers allows you to include output from another controller action into the current output.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
// IndexController.php public function widgetenabledoutputAction() { $html = "<ul>"; for ($i = 1; $i <= 5; $i++) { echo "<li>Item $i</li>"; } $html .= "</ul>"; $this->view->html = $html; } // index action view script (index.phtml), notice we are not calling widgetenabledoutputAction but can get output from it echo $this->action( $action = "widgetenabledoutput", $controller = "index", $module = null, "itemsPerPage" => 2 // can pass params as array ) );