/** * Do some initialization on startup of every action * * @return void */ public function init() { parent::init(); $this->view->title = $this->_request->getModuleName() . '_' . $this->_request->getParam('controller') . '_' . $this->_request->getParam('action'); $this->_redirector = $this->_helper->getHelper('Redirector'); $this->_flashMessenger = $this->_helper->getHelper('FlashMessenger'); $this->view->flashMessenger = $this->_flashMessenger; $this->_breadcrumbs = $this->_helper->getHelper('breadcrumbs'); }
/** * Deliver the (transformed) Xml content * * @return void */ public function postDispatch() { if (!isset($this->view->errorMessage)) { // Send Xml response. $this->getResponse()->setHeader('Content-Type', 'text/xml; charset=UTF-8', true); if (false === is_null($this->_xslt)) { $this->getResponse()->setBody($this->_proc->transformToXML($this->_xml)); } else { $this->getResponse()->setBody($this->_xml->saveXml()); } } parent::postDispatch(); }
/** * Maps action calls to export plugins or returns an error message. * * @param string $action The name of the action that was called. * @param array $parameters The parameters passed to the action. * @return void */ public function __call($action, $parameters) { // TODO what does this code do if (!'Action' == substr($action, -6)) { $this->getLogger()->info(__METHOD__ . ' undefined method: ' . $action); parent::__call($action, $parameters); } $actionName = $this->getRequest()->getActionName(); $this->getLogger()->debug("Request to export plugin {$actionName}"); $plugin = $this->getPlugin($actionName); if (!is_null($plugin)) { $plugin->init(); $plugin->execute(); $plugin->postDispatch(); } else { throw new Application_Exception('Plugin ' . htmlspecialchars($actionName) . ' not found'); } }