gMail-27 wrote:
> 
> Can I get an action controller instance from within a controller
> plugin (class MyPlugin extends Zend_Controller_Plugin_Abstract).
> 
You may use response object:



class MyController ...
{
  protected $_layout = 'default';
   ...
  function getLayout()
  {
    return $_layout;
  }
  function postDispatch()
  {
     $this->getResponse()->setController($this);
  }
   ...
}

class My_Controller_Response_Http ...
{
  protected $_controller;
  ...
  function setController(Zend_Controller_Action $controller)
  {
    $this->_controller = $controller;
  }
  function getController()
  {
    return $this->_controller;
  }
  ...
}

class My_Controller_Plugin_Layout ...
{
  function ...
  {
      $layout = $this->getResponse()->getController()->getLayout();
  }
}


http://www.nabble.com/Layout-templates-tf3432215s16154.html#a9567943
-- 
View this message in context: 
http://www.nabble.com/Zend-Controller%3A-get-controller-instance-from-within-a-plugin-tf3483629s16154.html#a9728342
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to