views:

65

answers:

1

I create a plugin for my header, footer actionStack. I try to find a way to check if the action layout is $this->_helper->layout->disableLayout(). This is my plugin:

class Default_Plugin_RenderPosition extends Zend_Controller_Plugin_Abstract {
    public function dispatchLoopStartup(Zend_Controller_Request_Abstract $request) {
        $auth = Zend_Auth::getInstance();
        $layout = Zend_Layout::getMvcInstance();

        if (!$request->isXmlHttpRequest() && $auth->hasIdentity() && $layout->isEnabled()) {
            $contents = array(
                0 => array('controller' => 'renderposition', 'action' => 'header', 'position' => 'head'),
                1 => array('controller' => 'renderposition', 'action' => 'footer', 'position' => 'foot')
            );

            foreach ($contents as $item) {
                $action_stack = new Zend_Controller_Action_Helper_ActionStack();
                $action_stack->actionToStack($item['action'],
                    $item['controller'],
                    'default',
                    array('position' => $item['position']));
            }
        }
    }

}

this is my action:

public function greyboxAction(){
   $this->_helper->layout->disableLayout();
}

is Zend_Auth::getInstance() the one I should call for check my action layout? Could some one help me?Thanks

A: 

I need a way could have several blocks within a page. I did some research on that, so far render and partial only could do the view script and passing some data. Is there some better way could do that.

Right now I have $request->getParam('greybox', false) working around that, can i get more help?

ywang036