php - Zend 1 - Render another controller from a controller -
i'm trying change our current layout requesting controller contents ajax instead of reloading page each time user clicks on item of menu. long story short: need load controller controller. let's have controller named ajaxcontroller.php
receive controller , action need render post , needs return requested controller html response without layout.
right have following code on controller:
class ajaxhelpercontroller extends default_model_views_basic { protected $_redirector = null; public function init() { $this->_redirector = $this->_helper->gethelper('redirector'); } public function indexaction() { $valor = $this->_request->getparam('valor'); $this->disablelayout(); $this->_helper->viewrenderer->setnorender(); $this->_redirector->gotourl('http://desarrollo.techmaker.net/eloy/svn/eplanv30/public/demo_eplan_profesional/gestordocumental/gestordocumental'); } }
the problem redirects page loading complete layout, need load without layout. there way of doing without needing change each controller logic?
to render controller current controller without page reloading can use _forward() method:
_forward($action, $controller = null, $module = null, array $params = null): perform action.
it run action controller. see details on the: http://framework.zend.com/manual/1.12/en/zend.controller.action.html
Comments
Post a Comment