I’ve got 2 controllers.
-
CategoryController
public function readAction() { $id = $this->_request->getParam('id'); $categoryModel = new Model_Category(); if(!$categoryModel) { throw new \Exception(__METHOD__.', could not create category model'); } $category = $categoryModel->getCategory($id); $parent = $category->findParentRow(new Model_Category()); if(!$parent) { $this->view->parent = 'no parent'; } else { $this->view->parent = $parent->name; } // I need to pass category object to read.phtml of controller category // so that each attributes of the category could be displayed. $this->view->category = $category; // Below the category section, I also need to list all // the business entities which are the child rows of that category. // So I forward to controller business, action list. // Normally I use list.phtml in controller business to do that. $this->_forward('list', 'business'); } -
BusinessController
But after I call _forward, the read.phtml is not diplayed, I could see only the list.phtml of controller business.
My question is, what could I do if I want to call read.phtml of controller category, and list.phtml of controller business at the same time?
Render current action before forwarding: