/** * Instance of construct * * @param string $layout * @param array $options */ public function __construct($layout = 'email', array $options = array()) { $this->frontController = \Zend_Controller_Front::getInstance(); $resources = $this->frontController->getParam('bootstrap')->getOption('resources'); if (isset($options['layout'])) { $this->layout = new \Zend_Layout($options['layout']); } elseif (isset($resources['layout'])) { $this->layout = new \Zend_Layout($resources['layout']); } else { $this->layout = new \Zend_Layout(); } if (isset($options['view'])) { $this->layout->setView(new \Zend_View($options['view'])); } elseif (isset($resources['view'])) { $this->layout->setView(new \Zend_View($resources['view'])); } else { $this->layout->setView(new \Zend_View()); } $scriptPath = APPLICATION_PATH . self::EMAIL_PATH; if (null !== $this->frontController->getModuleDirectory()) { $scriptPath = $this->frontController->getModuleDirectory() . self::EMAIL_PATH; } $this->layout->setLayout($layout); $this->setScriptPath($scriptPath); }
/** * dispatchLoopStartup * * @param Zend_Controller_Request_Abstract $oRequest * @return void */ public function dispatchLoopStartup(Zend_Controller_Request_Abstract $oRequest) { // Set layout $_layout = $this->_front->getParam('bootstrap')->getPluginResource("layout")->getLayout(); // Create empty layoutPath array $layoutPathAr = array(); // Loop theme basePath foreach ($this->_basePaths as $basePath) { foreach ($this->_themes as $theme) { // Mount basepath $path = $basePath . "/" . $theme; // Populate layoutPath array $layoutPathAr[] .= $path . "/scripts/layouts/"; } } // Set layout path $_layout->setLayoutPath($layoutPathAr); }
/** * _responseException * * @return void */ private function _responseException() { if (!$this->_viewRenderer->getResponse()->isException()) { return; } $frontOptions = $this->_front->getParam('bootstrap')->getPluginResource("frontController")->getOptions(); if (!isset($frontOptions['params']['displayExceptions'])) { return; } if ($frontOptions['params']['displayExceptions'] === false) { return; } $exceptions = $this->_viewRenderer->getResponse()->getException(); $this->_view->exception = array(); $this->_view->trace = array(); foreach ($exceptions as $exception) { $message = $exception->getMessage(); $trace = $exception->getTraceAsString(); $this->_view->exception[] = $message; $this->_view->trace[] = $trace; } }
/** Construct the variables * @access public * @return void */ public function __construct() { $this->_front = Zend_Controller_Front::getInstance()->getRequest(); $this->_param = $this->_front->getParam('slug'); }