public function captchaReloadAction() { $baseDir = $this->view->baseUrl(); $captcha_image = new Zend_Captcha_Image(array('captcha' => 'Word', 'wordLen' => 6, 'height' => 50, 'width' => 150, 'timeout' => 600, 'dotNoiseLevel' => 0, 'lineNoiseLevel' => 0, 'font' => Zend_Registry::get('application_path') . "/../{$this->_config->document_root}/captcha/fonts/ARIAL.TTF", 'imgDir' => Zend_Registry::get('application_path') . "/../{$this->_config->document_root}/captcha/tmp", 'imgUrl' => "{$baseDir}/captcha/tmp")); $image = $captcha_image->generate(); $captcha['id'] = $captcha_image->getId(); $captcha['word'] = $captcha_image->getWord(); $captcha['url'] = $captcha_image->getImgUrl() . $image . $captcha_image->getSuffix(); $this->_helper->layout()->disableLayout(); $this->_helper->viewRenderer->setNoRender(true); echo Zend_Json::encode($captcha); }