public function init() { $this->_helper->contextSwitch()->addActionContext('error', 'json'); $this->_helper->contextSwitch()->addActionContext('login', 'json'); $this->_helper->contextSwitch()->addActionContext('logout', 'json'); $viewRenderer = Zend_Controller_Action_HelperBroker::getExistingHelper('viewRenderer'); $viewRenderer->setNoRender(); parent::init(); }
public function init() { $this->_helper->contextSwitch()->addActionContext('regenerate-images', 'json'); $this->_helper->contextSwitch()->addActionContext('regenerate-image', 'json'); $this->_helper->contextSwitch()->addActionContext('spider', 'json'); $this->_helper->contextSwitch()->addActionContext('update-all', 'json'); $this->_helper->contextSwitch()->addActionContext('migrate', 'json'); $this->_helper->contextSwitch()->addActionContext('bootstrap', 'json'); parent::init(); }
public function preDispatch() { parent::preDispatch(); $request = $this->getRequest(); if ($rel = $request->getParam('rel')) { if (method_exists($this, Inflector::camelize($rel) . 'Action') && !$request->getParam('final')) { $request->setActionName($rel)->setParam('final', true)->setDispatched(false); return; } Zend_Controller_Action_HelperBroker::getExistingHelper('viewRenderer')->setScriptAction($rel); } $this->_doRequestMethod(); Zend_Controller_Front::getInstance()->getResponse()->setHeader('Cache-control', 'must-revalidate', true); }