getRequest()->isAjax()) { $this->_redirect('/'); return; } $jsonData = json_encode(array('result' => true)); $this->getResponse()->setHeader('Content-type', 'application/json'); $this->getResponse()->setBody($jsonData); } }