Zend 1 – Render another controller from a controller

I’m trying to change our current layout for requesting the controller contents by AJAX instead of reloading the page each time the user clicks on any item of the menu. Long story short: I need to load a controller from another controller. Let’s say I have a controller named AjaxController.php that will receive the controller and action that it will need to render by POST and needs to return the requested controller HTML response without the layout.

Right now I only have the following code on the 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');                                    

The problem is it redirects to the page but loading the complete layout, I need to load it without the layout. Is there any way of doing this without needing to change each controller logic?

Source: ajax

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.